(svn r17316) -Codechange: use Industry::GetByTile() instead of GetIndustryByTile()

This commit is contained in:
smatz
2009-08-30 11:47:41 +00:00
parent c94b9973e6
commit ee685c8287
14 changed files with 52 additions and 55 deletions

View File

@@ -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();
};