summaryrefslogtreecommitdiff
path: root/src/depot_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/depot_base.h')
-rw-r--r--src/depot_base.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/depot_base.h b/src/depot_base.h
index 82d78eb60..8a7305088 100644
--- a/src/depot_base.h
+++ b/src/depot_base.h
@@ -19,8 +19,11 @@ typedef Pool<Depot, DepotID, 64, 64000> DepotPool;
extern DepotPool _depot_pool;
struct Depot : DepotPool::PoolItem<&_depot_pool> {
+ Town *town;
+ const char *name;
+
TileIndex xy;
- TownID town_index;
+ uint16 town_cn; ///< The Nth depot for this town (consecutive number)
Depot(TileIndex xy = INVALID_TILE) : xy(xy) {}
~Depot();
@@ -29,6 +32,17 @@ struct Depot : DepotPool::PoolItem<&_depot_pool> {
{
return Depot::Get(GetDepotIndex(tile));
}
+
+ /**
+ * Is the "type" of depot the same as the given depot,
+ * i.e. are both a rail, road or ship depots?
+ * @param d The depot to compare to.
+ * @return true iff their types are equal.
+ */
+ FORCEINLINE bool IsOfType(const Depot *d) const
+ {
+ return GetTileType(d->xy) == GetTileType(this->xy);
+ }
};
#define FOR_ALL_DEPOTS_FROM(var, start) FOR_ALL_ITEMS_FROM(Depot, depot_index, var, start)