From ee685c82874d2ab58efd46a496082b789156b0a7 Mon Sep 17 00:00:00 2001 From: smatz Date: Sun, 30 Aug 2009 11:47:41 +0000 Subject: (svn r17316) -Codechange: use Industry::GetByTile() instead of GetIndustryByTile() --- src/industry.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/industry.h') 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 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(); }; -- cgit v1.2.3-54-g00ecf