summaryrefslogtreecommitdiff
path: root/src/object_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/object_map.h')
-rw-r--r--src/object_map.h77
1 files changed, 17 insertions, 60 deletions
diff --git a/src/object_map.h b/src/object_map.h
index d50938942..7af58d27c 100644
--- a/src/object_map.h
+++ b/src/object_map.h
@@ -28,81 +28,38 @@ static inline ObjectType GetObjectType(TileIndex t)
}
/**
- * Get the index of which object this tile is attached to.
- * @param t the tile
- * @pre IsTileType(t, MP_OBJECT)
- * @return The ObjectID of the object.
- */
-static inline ObjectID GetObjectIndex(TileIndex t)
-{
- assert(IsTileType(t, MP_OBJECT));
- return _m[t].m2;
-}
-
-/**
- * Does the given tile have a transmitter?
- * @param t the tile to inspect.
- * @return true if and only if the tile has a transmitter.
- */
-static inline bool IsTransmitterTile(TileIndex t)
-{
- return IsTileType(t, MP_OBJECT) && GetObjectType(t) == OBJECT_TRANSMITTER;
-}
-
-/**
- * Is this object tile an 'owned land' tile?
- * @param t the tile to inspect.
+ * Check whether the object on a tile is of a specific type.
+ * @param t Tile to test.
+ * @param type Type to test.
* @pre IsTileType(t, MP_OBJECT)
- * @return true if and only if the tile is an 'owned land' tile.
+ * @return True if type matches.
*/
-static inline bool IsOwnedLand(TileIndex t)
+static inline bool IsObjectType(TileIndex t, ObjectType type)
{
- assert(IsTileType(t, MP_OBJECT));
- return GetObjectType(t) == OBJECT_OWNED_LAND;
+ return GetObjectType(t) == type;
}
/**
- * Is the given tile (pre-)owned by someone (the little flags)?
- * @param t the tile to inspect.
- * @return true if and only if the tile is an 'owned land' tile.
+ * Check whether a tile is a object tile of a specific type.
+ * @param t Tile to test.
+ * @param type Type to test.
+ * @return True if type matches.
*/
-static inline bool IsOwnedLandTile(TileIndex t)
+static inline bool IsObjectTypeTile(TileIndex t, ObjectType type)
{
- return IsTileType(t, MP_OBJECT) && IsOwnedLand(t);
+ return IsTileType(t, MP_OBJECT) && GetObjectType(t) == type;
}
/**
- * Is this object tile a HQ tile?
- * @param t the tile to inspect.
- * @pre IsTileType(t, MP_OBJECT)
- * @return true if and only if the tile is a HQ tile.
- */
-static inline bool IsCompanyHQ(TileIndex t)
-{
- assert(IsTileType(t, MP_OBJECT));
- return _m[t].m5 == OBJECT_HQ;
-}
-
-/**
- * Is this object tile a statue?
- * @param t the tile to inspect.
+ * Get the index of which object this tile is attached to.
+ * @param t the tile
* @pre IsTileType(t, MP_OBJECT)
- * @return true if and only if the tile is a statue.
+ * @return The ObjectID of the object.
*/
-static inline bool IsStatue(TileIndex t)
+static inline ObjectID GetObjectIndex(TileIndex t)
{
assert(IsTileType(t, MP_OBJECT));
- return GetObjectType(t) == OBJECT_STATUE;
-}
-
-/**
- * Is the given tile a statue?
- * @param t the tile to inspect.
- * @return true if and only if the tile is a statue.
- */
-static inline bool IsStatueTile(TileIndex t)
-{
- return IsTileType(t, MP_OBJECT) && IsStatue(t);
+ return _m[t].m2;
}
/**