2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 /** @file map/object.h Map tile accessors for object tiles. */
13 #include "../stdafx.h"
14 #include "../tile/common.h"
15 #include "../tile/object.h"
19 #include "../company_type.h"
20 #include "../object_type.h"
23 * Get the index of which object this tile is attached to.
25 * @pre IsObjectTile(t)
26 * @return The ObjectID of the object.
28 static inline ObjectID
GetObjectIndex(TileIndex t
)
30 return tile_get_object_index(&_mc
[t
]);
34 * Get the random bits of this tile.
35 * @param t The tile to get the bits for.
36 * @pre IsObjectTile(t)
37 * @return The random bits.
39 static inline byte
GetObjectRandomBits(TileIndex t
)
41 assert(IsObjectTile(t
));
42 return tile_get_random_bits(&_mc
[t
]);
47 * Make an Object tile.
48 * @param t The tile to make and object tile.
49 * @param o The new owner of the tile.
50 * @param index Index to the object.
51 * @param wc Water class for this object.
52 * @param random Random data to store on the tile
54 static inline void MakeObject(TileIndex t
, Owner o
, ObjectID index
, WaterClass wc
, byte random
)
56 tile_make_object(&_mc
[t
], o
, index
, wc
, random
);
59 #endif /* MAP_OBJECT_H */