author | celestar |
Wed, 29 Mar 2006 16:30:26 +0000 | |
changeset 3355 | a653b8e47f27 |
parent 3331 | 917914fbbf3c |
child 3369 | 00c2ca209a89 |
permissions | -rw-r--r-- |
3314
b8b234d4584f
(svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff
changeset
|
1 |
/* $Id$ */ |
b8b234d4584f
(svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff
changeset
|
2 |
|
b8b234d4584f
(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" |
b8b234d4584f
(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" |
b8b234d4584f
(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" |
b8b234d4584f
(svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff
changeset
|
6 |
|
b8b234d4584f
(svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff
changeset
|
7 |
|
b8b234d4584f
(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) |
b8b234d4584f
(svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff
changeset
|
9 |
{ |
b8b234d4584f
(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; |
b8b234d4584f
(svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff
changeset
|
11 |
} |
b8b234d4584f
(svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff
changeset
|
12 |
|
b8b234d4584f
(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) |
b8b234d4584f
(svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff
changeset
|
14 |
{ |
b8b234d4584f
(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)); |
b8b234d4584f
(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
c5f2375046bc
(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) |
c5f2375046bc
(svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents:
3320
diff
changeset
|
20 |
{ |
c5f2375046bc
(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); |
c5f2375046bc
(svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents:
3320
diff
changeset
|
22 |
} |
c5f2375046bc
(svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents:
3320
diff
changeset
|
23 |
|
c5f2375046bc
(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 |
} |