author | rubidium |
Thu, 01 Feb 2007 15:49:12 +0000 | |
changeset 5893 | 7e431a4abebb |
parent 5475 | 2e6990a8c7c4 |
child 5969 | 57cbd6e884f5 |
permissions | -rw-r--r-- |
3319
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
1 |
/* $Id$ */ |
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
2 |
|
3432
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
3 |
/** @file town_map.h Accessors for towns */ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
4 |
|
3426
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
5 |
#ifndef TOWN_MAP_H |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
6 |
#define TOWN_MAP_H |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
7 |
|
3319
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
8 |
#include "town.h" |
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
9 |
|
3377
608cf1405409
(svn r4179) -Codechange: Add and make use of an accessor that obtains the building type
celestar
parents:
3369
diff
changeset
|
10 |
static inline int GetHouseType(TileIndex t) |
608cf1405409
(svn r4179) -Codechange: Add and make use of an accessor that obtains the building type
celestar
parents:
3369
diff
changeset
|
11 |
{ |
608cf1405409
(svn r4179) -Codechange: Add and make use of an accessor that obtains the building type
celestar
parents:
3369
diff
changeset
|
12 |
assert(IsTileType(t, MP_HOUSE)); |
608cf1405409
(svn r4179) -Codechange: Add and make use of an accessor that obtains the building type
celestar
parents:
3369
diff
changeset
|
13 |
return _m[t].m4; |
608cf1405409
(svn r4179) -Codechange: Add and make use of an accessor that obtains the building type
celestar
parents:
3369
diff
changeset
|
14 |
} |
3319
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
15 |
|
3432
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
16 |
static inline TownID GetTownIndex(TileIndex t) |
3319
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
17 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3319
diff
changeset
|
18 |
assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_STREET)); // XXX incomplete |
3319
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
19 |
return _m[t].m2; |
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
20 |
} |
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
21 |
|
3432
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
22 |
/** |
3983
0f815283e04b
(svn r5171) Get rid of an ungly hack in the load routine, which temporarily turned house and road tiles into void tiles to calculate the closest town
tron
parents:
3432
diff
changeset
|
23 |
* Set the town index for a road or house tile. |
3432
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
24 |
* @param tile the tile |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
25 |
* @param index the index of the town |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
26 |
*/ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
27 |
static inline void SetTownIndex(TileIndex t, TownID index) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
28 |
{ |
3983
0f815283e04b
(svn r5171) Get rid of an ungly hack in the load routine, which temporarily turned house and road tiles into void tiles to calculate the closest town
tron
parents:
3432
diff
changeset
|
29 |
assert(IsTileType(t, MP_STREET) || IsTileType(t, MP_HOUSE)); |
3432
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
30 |
_m[t].m2 = index; |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
31 |
} |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
32 |
|
3426
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
33 |
static inline bool LiftHasDestination(TileIndex t) |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
34 |
{ |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
35 |
return HASBIT(_m[t].m5, 7); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
36 |
} |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
37 |
|
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
38 |
static inline void SetLiftDestination(TileIndex t, byte dest) |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
39 |
{ |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
40 |
SB(_m[t].m5, 0, 6, dest); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
41 |
SETBIT(_m[t].m1, 7); /* Start moving */ |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
42 |
} |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
43 |
|
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
44 |
static inline byte GetLiftDestination(TileIndex t) |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
45 |
{ |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
46 |
return GB(_m[t].m5, 0, 6); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
47 |
} |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
48 |
|
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
49 |
static inline bool IsLiftMoving(TileIndex t) |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
50 |
{ |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
51 |
return HASBIT(_m[t].m1, 7); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
52 |
} |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
53 |
|
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
54 |
static inline void BeginLiftMovement(TileIndex t) |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
55 |
{ |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
56 |
SETBIT(_m[t].m5, 7); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
57 |
} |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
58 |
|
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
59 |
static inline void HaltLift(TileIndex t) |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
60 |
{ |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
61 |
CLRBIT(_m[t].m1, 7); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
62 |
CLRBIT(_m[t].m5, 7); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
63 |
SB(_m[t].m5, 0, 6, 0); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
64 |
|
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
65 |
DeleteAnimatedTile(t); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
66 |
} |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
67 |
|
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
68 |
static inline byte GetLiftPosition(TileIndex t) |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
69 |
{ |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
70 |
return GB(_m[t].m1, 0, 7); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
71 |
} |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
72 |
|
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
73 |
static inline void SetLiftPosition(TileIndex t, byte pos) |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
74 |
{ |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
75 |
SB(_m[t].m1, 0, 7, pos); |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
76 |
} |
451a6367552d
(svn r4254) -Codechange: Add and make use of map accessors for town lifts.
celestar
parents:
3382
diff
changeset
|
77 |
|
3319
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
78 |
static inline Town* GetTownByTile(TileIndex t) |
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
79 |
{ |
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
80 |
return GetTown(GetTownIndex(t)); |
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
81 |
} |
3382
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
82 |
|
3983
0f815283e04b
(svn r5171) Get rid of an ungly hack in the load routine, which temporarily turned house and road tiles into void tiles to calculate the closest town
tron
parents:
3432
diff
changeset
|
83 |
|
0f815283e04b
(svn r5171) Get rid of an ungly hack in the load routine, which temporarily turned house and road tiles into void tiles to calculate the closest town
tron
parents:
3432
diff
changeset
|
84 |
Town* CalcClosestTownFromTile(TileIndex tile, uint threshold); |
0f815283e04b
(svn r5171) Get rid of an ungly hack in the load routine, which temporarily turned house and road tiles into void tiles to calculate the closest town
tron
parents:
3432
diff
changeset
|
85 |
|
0f815283e04b
(svn r5171) Get rid of an ungly hack in the load routine, which temporarily turned house and road tiles into void tiles to calculate the closest town
tron
parents:
3432
diff
changeset
|
86 |
|
3382
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
87 |
static inline void MakeHouseTile(TileIndex t, TownID tid, byte counter, byte stage, byte type) |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
88 |
{ |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
89 |
assert(IsTileType(t, MP_CLEAR)); |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
90 |
|
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
91 |
SetTileType(t, MP_HOUSE); |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
92 |
_m[t].m1 = 0; |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
93 |
_m[t].m2 = tid; |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
94 |
SB(_m[t].m3, 6, 2, stage); |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
95 |
_m[t].m4 = type; |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
96 |
SB(_m[t].m5, 0, 2, counter); |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
97 |
|
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
98 |
MarkTileDirtyByTile(t); |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
99 |
} |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
100 |
|
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
101 |
enum { |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
102 |
TWO_BY_TWO_BIT = 2, ///< House is two tiles in X and Y directions |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
103 |
ONE_BY_TWO_BIT = 1, ///< House is two tiles in Y direction |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
104 |
TWO_BY_ONE_BIT = 0, ///< House is two tiles in X direction |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
105 |
}; |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
106 |
|
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
107 |
static inline void MakeTownHouse(TileIndex t, TownID tid, byte counter, byte stage, byte size, byte type) |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
108 |
{ |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
109 |
MakeHouseTile(t, tid, counter, stage, type); |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
110 |
if (HASBIT(size, TWO_BY_TWO_BIT) || HASBIT(size, ONE_BY_TWO_BIT)) MakeHouseTile(t + TileDiffXY(0, 1), tid, counter, stage, ++type); |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
111 |
if (HASBIT(size, TWO_BY_TWO_BIT) || HASBIT(size, TWO_BY_ONE_BIT)) MakeHouseTile(t + TileDiffXY(1, 0), tid, counter, stage, ++type); |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
112 |
if (HASBIT(size, TWO_BY_TWO_BIT)) MakeHouseTile(t + TileDiffXY(1, 1), tid, counter, stage, ++type); |
be14efb0dfd7
(svn r4190) -Codechange: Add and make use of an accessor function to create houses
celestar
parents:
3377
diff
changeset
|
113 |
} |
3432
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
114 |
|
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
115 |
/** |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
116 |
* House Construction Scheme. |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
117 |
* Construction counter, for buildings under construction. Incremented on every |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
118 |
* periodic tile processing. |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
119 |
* On wraparound, the stage of building in is increased. |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
120 |
* (Get|Set|Inc)HouseBuildingStage are taking care of the real stages, |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
121 |
* (as the sprite for the next phase of house building) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
122 |
* (Get|Set|Inc)HouseConstructionTick is simply a tick counter between the |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
123 |
* different stages |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
124 |
*/ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
125 |
|
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
126 |
/** |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
127 |
* Gets the building stage of a house |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
128 |
* @param tile the tile of the house to get the building stage of |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
129 |
* @pre IsTileType(t, MP_HOUSE) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
130 |
* @return the building stage of the house |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
131 |
*/ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
132 |
static inline byte GetHouseBuildingStage(TileIndex t) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
133 |
{ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
134 |
assert(IsTileType(t, MP_HOUSE)); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
135 |
return GB(_m[t].m3, 6, 2); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
136 |
} |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
137 |
|
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
138 |
/** |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
139 |
* Sets the building stage of a house |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
140 |
* @param tile the tile of the house to set the building stage of |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
141 |
* @param stage the new stage |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
142 |
* @pre IsTileType(t, MP_HOUSE) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
143 |
*/ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
144 |
static inline void SetHouseBuildingStage(TileIndex t, byte stage) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
145 |
{ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
146 |
assert(IsTileType(t, MP_HOUSE)); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
147 |
SB(_m[t].m3, 6, 2, stage); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
148 |
} |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
149 |
|
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
150 |
/** |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
151 |
* Increments the building stage of a house |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
152 |
* @param tile the tile of the house to increment the building stage of |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
153 |
* @pre IsTileType(t, MP_HOUSE) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
154 |
*/ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
155 |
static inline void IncHouseBuildingStage( TileIndex t ) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
156 |
{ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
157 |
assert(IsTileType(t, MP_HOUSE)); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
158 |
AB(_m[t].m3, 6, 2, 1); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
159 |
} |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
160 |
|
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
161 |
/** |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
162 |
* Gets the construction stage of a house |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
163 |
* @param tile the tile of the house to get the construction stage of |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
164 |
* @pre IsTileType(t, MP_HOUSE) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
165 |
* @return the construction stage of the house |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
166 |
*/ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
167 |
static inline byte GetHouseConstructionTick(TileIndex t) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
168 |
{ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
169 |
assert(IsTileType(t, MP_HOUSE)); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
170 |
return GB(_m[t].m5, 0, 3); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
171 |
} |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
172 |
|
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
173 |
/** |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
174 |
* Sets the construction stage of a house |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
175 |
* @param tile the tile of the house to set the construction stage of |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
176 |
* @param stage the new stage |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
177 |
* @pre IsTileType(t, MP_HOUSE) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
178 |
*/ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
179 |
static inline void SetHouseConstructionTick(TileIndex t, byte stage) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
180 |
{ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
181 |
assert(IsTileType(t, MP_HOUSE)); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
182 |
SB(_m[t].m5, 0, 3, stage); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
183 |
} |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
184 |
|
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
185 |
/** |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
186 |
* Sets the increment stage of a house |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
187 |
* @param tile the tile of the house to increment the construction stage of |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
188 |
* @pre IsTileType(t, MP_HOUSE) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
189 |
*/ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
190 |
static inline void IncHouseConstructionTick(TileIndex t) |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
191 |
{ |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
192 |
assert(IsTileType(t, MP_HOUSE)); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
193 |
AB(_m[t].m5, 0, 3, 1); |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
194 |
} |
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
195 |
|
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
196 |
|
650dd1972479
(svn r4261) CodeChange : Add and Use Accessor for Houses Construction. And cleaning on town.flags12 too
belugas
parents:
3426
diff
changeset
|
197 |
#endif /* TOWN_MAP_H */ |