summaryrefslogtreecommitdiff
path: root/src/industry.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-08-30 11:47:41 +0000
committersmatz <smatz@openttd.org>2009-08-30 11:47:41 +0000
commitee685c82874d2ab58efd46a496082b789156b0a7 (patch)
tree306d6b4355688a2c787c19667b284a317d428d1b /src/industry.h
parentc94b9973e60959cdb9bd706bddbf79727fb4dbe7 (diff)
downloadopenttd-ee685c82874d2ab58efd46a496082b789156b0a7.tar.xz
(svn r17316) -Codechange: use Industry::GetByTile() instead of GetIndustryByTile()
Diffstat (limited to 'src/industry.h')
-rw-r--r--src/industry.h15
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();
};