depot_base.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef DEPOT_BASE_H
00013 #define DEPOT_BASE_H
00014
00015 #include "depot_map.h"
00016 #include "core/pool_type.hpp"
00017
00018 typedef Pool<Depot, DepotID, 64, 64000> DepotPool;
00019 extern DepotPool _depot_pool;
00020
00021 struct Depot : DepotPool::PoolItem<&_depot_pool> {
00022 TileIndex xy;
00023 TownID town_index;
00024
00025 Depot(TileIndex xy = INVALID_TILE) : xy(xy) {}
00026 ~Depot();
00027
00028 static FORCEINLINE Depot *GetByTile(TileIndex tile)
00029 {
00030 return Depot::Get(GetDepotIndex(tile));
00031 }
00032 };
00033
00034 #define FOR_ALL_DEPOTS_FROM(var, start) FOR_ALL_ITEMS_FROM(Depot, depot_index, var, start)
00035 #define FOR_ALL_DEPOTS(var) FOR_ALL_DEPOTS_FROM(var, 0)
00036
00037 #endif