diff options
Diffstat (limited to 'src/industry.h')
-rw-r--r-- | src/industry.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/industry.h b/src/industry.h index 0dbbb5e03..32f403f96 100644 --- a/src/industry.h +++ b/src/industry.h @@ -19,11 +19,9 @@ #include "economy_type.h" #include "map_type.h" #include "industry_type.h" -#include "industrytype.h" #include "tile_type.h" #include "subsidy_type.h" -#include "town_type.h" -#include "date_type.h" +#include "industry_map.h" typedef Pool<Industry, IndustryID, 64, 64000> IndustryPool; @@ -74,6 +72,17 @@ struct Industry : IndustryPool::PoolItem<&_industry_pool> { Industry(TileIndex tile = INVALID_TILE) : xy(tile) {} ~Industry(); + /** + * Get the industry of the given tile + * @param t the tile to get the industry from + * @pre IsTileType(t, MP_INDUSTRY) + * @return the industry + */ + static FORCEINLINE Industry *GetByTile(TileIndex tile) + { + return Industry::Get(GetIndustryIndex(tile)); + } + static Industry *GetRandom(); }; |