author | Darkvater |
Sun, 26 Mar 2006 16:29:20 +0000 | |
changeset 3335 | caea2aff4db6 |
parent 3331 | da6bbabbb6cc |
child 3369 | cab209754317 |
permissions | -rw-r--r-- |
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 | 17 |
|
18 |
||
3321
4061bfef1830
(svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents:
3320
diff
changeset
|
19 |
static inline bool IsIndustryCompleted(TileIndex tile) |
4061bfef1830
(svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents:
3320
diff
changeset
|
20 |
{ |
4061bfef1830
(svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents:
3320
diff
changeset
|
21 |
return HASBIT(_m[tile].m1, 7); |
4061bfef1830
(svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents:
3320
diff
changeset
|
22 |
} |
4061bfef1830
(svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents:
3320
diff
changeset
|
23 |
|
4061bfef1830
(svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents:
3320
diff
changeset
|
24 |
|
3331 | 25 |
static inline uint GetIndustryGfx(TileIndex t) |
26 |
{ |
|
27 |
return _m[t].m5; |
|
28 |
} |
|
29 |
||
30 |
static inline void SetIndustryGfx(TileIndex t, uint gfx) |
|
31 |
{ |
|
32 |
_m[t].m5 = gfx; |
|
33 |
} |
|
34 |
||
35 |
||
3320 | 36 |
static inline void MakeIndustry(TileIndex t, uint index, uint gfx) |
37 |
{ |
|
38 |
SetTileType(t, MP_INDUSTRY); |
|
39 |
_m[t].m1 = 0; |
|
40 |
_m[t].m2 = index; |
|
41 |
_m[t].m3 = 0; |
|
42 |
_m[t].m4 = 0; |
|
43 |
_m[t].m5 = gfx; |
|
44 |
} |