industry_map.h
author tron
Fri, 24 Mar 2006 13:31:17 +0000
changeset 3320 e9e284ab853a
parent 3314 6aaeba4b92e8
child 3321 4061bfef1830
permissions -rw-r--r--
(svn r4086) Add MakeIndustry()
3314
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     1
/* $Id$ */
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     2
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     3
#include "industry.h"
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     4
#include "macros.h"
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     5
#include "tile.h"
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     6
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     7
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     8
static inline uint GetIndustryIndex(TileIndex t)
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     9
{
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    10
	return _m[t].m2;
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    11
}
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    12
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    13
static inline Industry* GetIndustryByTile(TileIndex t)
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    14
{
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    15
	return GetIndustry(GetIndustryIndex(t));
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    16
}
3320
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    17
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    18
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    19
static inline void MakeIndustry(TileIndex t, uint index, uint gfx)
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    20
{
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    21
	SetTileType(t, MP_INDUSTRY);
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    22
	_m[t].m1 = 0;
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    23
	_m[t].m2 = index;
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    24
	_m[t].m3 = 0;
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    25
	_m[t].m4 = 0;
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    26
	_m[t].m5 = gfx;
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    27
}