Add support for deleted functions
[openttd/fttd.git] / src / map / object.h
blobffee9adb5c2c8f0673fd70763c9163f6016373a3
1 /*
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/>.
6 */
8 /** @file map/object.h Map tile accessors for object tiles. */
10 #ifndef MAP_OBJECT_H
11 #define MAP_OBJECT_H
13 #include "../stdafx.h"
14 #include "../tile/common.h"
15 #include "../tile/object.h"
16 #include "map.h"
17 #include "class.h"
18 #include "coord.h"
19 #include "../company_type.h"
20 #include "../object_type.h"
22 /**
23 * Get the index of which object this tile is attached to.
24 * @param t the tile
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]);
33 /**
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]);
46 /**
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 */