author | KUDr |
Sat, 21 Apr 2007 08:23:57 +0000 | |
branch | cpp_gui |
changeset 6308 | 646711c5feaa |
parent 6307 | f40e88cff863 |
permissions | -rw-r--r-- |
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
1 |
/* $Id$ */ |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
2 |
|
6307 | 3 |
/** @file unmovable_map.h */ |
4 |
||
4666
850b5b6e4bac
(svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents:
3971
diff
changeset
|
5 |
#ifndef UNMOVABLE_MAP_H |
850b5b6e4bac
(svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents:
3971
diff
changeset
|
6 |
#define UNMOVABLE_MAP_H |
850b5b6e4bac
(svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents:
3971
diff
changeset
|
7 |
|
3427
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
8 |
enum { |
6308 | 9 |
HQ_NUM_TILE = 4, ///< Number of HQ tiles |
10 |
HQ_NUM_SIZE = 5 ///< Number of stages of an HQ |
|
3427
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
11 |
}; |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
12 |
|
6308 | 13 |
/** Types of unmovable structure */ |
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
14 |
enum UnmovableType { |
6308 | 15 |
UNMOVABLE_TRANSMITTER = 0, ///< The large antenna |
16 |
UNMOVABLE_LIGHTHOUSE = 1, ///< The nice lighthouse |
|
17 |
UNMOVABLE_STATUE = 2, ///< Statue in towns |
|
18 |
UNMOVABLE_OWNED_LAND = 3, ///< Owned land 'flag' |
|
19 |
UNMOVABLE_HQ_NORTH = 0x80, ///< Offset for the northern HQ tile |
|
20 |
UNMOVABLE_HQ_WEST = 0x81, ///< Offset for the western HQ tile |
|
21 |
UNMOVABLE_HQ_EAST = 0x82, ///< Offset for the eastern HQ tile |
|
22 |
UNMOVABLE_HQ_SOUTH = 0x83, ///< Offset for the southern HQ tile |
|
3427
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
23 |
|
6308 | 24 |
/** End of the HQ (rather end + 1 for IS_INT_INSIDE) */ |
3427
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
25 |
UNMOVABLE_HQ_END = UNMOVABLE_HQ_NORTH + HQ_NUM_SIZE * HQ_NUM_TILE |
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
26 |
}; |
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
27 |
|
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
28 |
|
3427
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
29 |
|
6308 | 30 |
/** |
31 |
* Gets the UnmovableType of the given unmovable tile |
|
32 |
* @param t the tile to get the type from. |
|
33 |
* @pre IsTileType(t, MP_UNMOVABLE) |
|
34 |
* @return the type. |
|
35 |
*/ |
|
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
36 |
static inline UnmovableType GetUnmovableType(TileIndex t) |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
37 |
{ |
3369
00c2ca209a89
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3310
diff
changeset
|
38 |
assert(IsTileType(t, MP_UNMOVABLE)); |
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5726
diff
changeset
|
39 |
return (UnmovableType)_m[t].m5; |
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
40 |
} |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
41 |
|
6308 | 42 |
/** |
43 |
* Does the given tile have a transmitter? |
|
44 |
* @param t the tile to inspect. |
|
45 |
* @return true if and only if the tile has a transmitter. |
|
46 |
*/ |
|
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
47 |
static inline bool IsTransmitterTile(TileIndex t) |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
48 |
{ |
6308 | 49 |
return IsTileType(t, MP_UNMOVABLE) && GetUnmovableType(t) == UNMOVABLE_TRANSMITTER; |
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
50 |
} |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
51 |
|
6308 | 52 |
/** |
53 |
* Is this unmovable tile an 'owned land' tile? |
|
54 |
* @param t the tile to inspect. |
|
55 |
* @pre IsTileType(t, MP_UNMOVABLE) |
|
56 |
* @return true if and only if the tile is an 'owned land' tile. |
|
57 |
*/ |
|
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
58 |
static inline bool IsOwnedLand(TileIndex t) |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
59 |
{ |
3369
00c2ca209a89
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3310
diff
changeset
|
60 |
assert(IsTileType(t, MP_UNMOVABLE)); |
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
61 |
return GetUnmovableType(t) == UNMOVABLE_OWNED_LAND; |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
62 |
} |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
63 |
|
6308 | 64 |
/** |
65 |
* Is the given tile (pre-)owned by someone (the little flags)? |
|
66 |
* @param t the tile to inspect. |
|
67 |
* @return true if and only if the tile is an 'owned land' tile. |
|
68 |
*/ |
|
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
69 |
static inline bool IsOwnedLandTile(TileIndex t) |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
70 |
{ |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
71 |
return IsTileType(t, MP_UNMOVABLE) && IsOwnedLand(t); |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
72 |
} |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
73 |
|
6308 | 74 |
/** |
75 |
* Is this unmovable tile a HQ tile? |
|
76 |
* @param t the tile to inspect. |
|
77 |
* @pre IsTileType(t, MP_UNMOVABLE) |
|
78 |
* @return true if and only if the tile is a HQ tile. |
|
79 |
*/ |
|
3427
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
80 |
static inline bool IsCompanyHQ(TileIndex t) |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
81 |
{ |
6308 | 82 |
assert(IsTileType(t, MP_UNMOVABLE)); |
3427
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
83 |
return IS_INT_INSIDE(GetUnmovableType(t), UNMOVABLE_HQ_NORTH, UNMOVABLE_HQ_END); |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
84 |
} |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
85 |
|
6308 | 86 |
/** |
87 |
* Is this unmovable tile a statue? |
|
88 |
* @param t the tile to inspect. |
|
89 |
* @pre IsTileType(t, MP_UNMOVABLE) |
|
90 |
* @return true if and only if the tile is a statue. |
|
91 |
*/ |
|
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
92 |
static inline bool IsStatue(TileIndex t) |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
93 |
{ |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
94 |
assert(IsTileType(t, MP_UNMOVABLE)); |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
95 |
return GetUnmovableType(t) == UNMOVABLE_STATUE; |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
96 |
} |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
97 |
|
6308 | 98 |
/** |
99 |
* Is the given tile a statue? |
|
100 |
* @param t the tile to inspect. |
|
101 |
* @return true if and only if the tile is a statue. |
|
102 |
*/ |
|
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
103 |
static inline bool IsStatueTile(TileIndex t) |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
104 |
{ |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
105 |
return IsTileType(t, MP_UNMOVABLE) && IsStatue(t); |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
106 |
} |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
107 |
|
6308 | 108 |
/** |
109 |
* Get the town of the given statue tile. |
|
110 |
* @param t the tile of the statue. |
|
111 |
* @pre IsStatueTile(t) |
|
112 |
* @return the town the given statue is in. |
|
113 |
*/ |
|
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
114 |
static inline TownID GetStatueTownID(TileIndex t) |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
115 |
{ |
6308 | 116 |
assert(IsStatueTile(t)); |
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
117 |
return _m[t].m2; |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
118 |
} |
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
119 |
|
6308 | 120 |
/** |
121 |
* Get the 'stage' of the HQ. |
|
122 |
* @param t a tile of the HQ. |
|
123 |
* @pre IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t) |
|
124 |
* @return the 'stage' of the HQ. |
|
125 |
*/ |
|
3427
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
126 |
static inline byte GetCompanyHQSize(TileIndex t) |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
127 |
{ |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
128 |
assert(IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t)); |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
129 |
return GB(_m[t].m5, 2, 3); |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
130 |
} |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
131 |
|
6308 | 132 |
/** |
133 |
* Get the 'section' (including stage) of the HQ. |
|
134 |
* @param t a tile of the HQ. |
|
135 |
* @pre IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t) |
|
136 |
* @return the 'section' of the HQ. |
|
137 |
*/ |
|
3427
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
138 |
static inline byte GetCompanyHQSection(TileIndex t) |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
139 |
{ |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
140 |
assert(IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t)); |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
141 |
return GB(_m[t].m5, 0, 5); |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
142 |
} |
98d955156735
(svn r4255) -Codechange: Add and make use of more accessor functions concerning unmovables. unmovable_cmd is now map access free
celestar
parents:
3388
diff
changeset
|
143 |
|
6308 | 144 |
/** |
145 |
* Enlarge the given HQ to the given size. If the new size |
|
146 |
* is larger than the current size, nothing happens. |
|
147 |
* @param t the tile of the HQ. |
|
148 |
* @param size the new size of the HQ. |
|
149 |
* @pre t is the northern tile of the HQ |
|
150 |
*/ |
|
3388
c802170b5dd4
(svn r4196) -Codechange: Add and make use of an accessor that modifies the size of the Company HQ
celestar
parents:
3385
diff
changeset
|
151 |
static inline void EnlargeCompanyHQ(TileIndex t, byte size) |
c802170b5dd4
(svn r4196) -Codechange: Add and make use of an accessor that modifies the size of the Company HQ
celestar
parents:
3385
diff
changeset
|
152 |
{ |
6308 | 153 |
assert(GB(GetCompanyHQSection(t), 0, 2) == 0); |
154 |
||
3705
539e1366ccae
(svn r4648) - Fix (r4196): Company HQ's were not upgraded during the monthly loops.
Darkvater
parents:
3427
diff
changeset
|
155 |
size *= 4; |
3388
c802170b5dd4
(svn r4196) -Codechange: Add and make use of an accessor that modifies the size of the Company HQ
celestar
parents:
3385
diff
changeset
|
156 |
if (size <= _m[t].m5 - UNMOVABLE_HQ_NORTH) return; |
c802170b5dd4
(svn r4196) -Codechange: Add and make use of an accessor that modifies the size of the Company HQ
celestar
parents:
3385
diff
changeset
|
157 |
|
3705
539e1366ccae
(svn r4648) - Fix (r4196): Company HQ's were not upgraded during the monthly loops.
Darkvater
parents:
3427
diff
changeset
|
158 |
_m[t + TileDiffXY(0, 0)].m5 = UNMOVABLE_HQ_NORTH + size; |
539e1366ccae
(svn r4648) - Fix (r4196): Company HQ's were not upgraded during the monthly loops.
Darkvater
parents:
3427
diff
changeset
|
159 |
_m[t + TileDiffXY(0, 1)].m5 = UNMOVABLE_HQ_WEST + size; |
539e1366ccae
(svn r4648) - Fix (r4196): Company HQ's were not upgraded during the monthly loops.
Darkvater
parents:
3427
diff
changeset
|
160 |
_m[t + TileDiffXY(1, 0)].m5 = UNMOVABLE_HQ_EAST + size; |
539e1366ccae
(svn r4648) - Fix (r4196): Company HQ's were not upgraded during the monthly loops.
Darkvater
parents:
3427
diff
changeset
|
161 |
_m[t + TileDiffXY(1, 1)].m5 = UNMOVABLE_HQ_SOUTH + size; |
3388
c802170b5dd4
(svn r4196) -Codechange: Add and make use of an accessor that modifies the size of the Company HQ
celestar
parents:
3385
diff
changeset
|
162 |
} |
c802170b5dd4
(svn r4196) -Codechange: Add and make use of an accessor that modifies the size of the Company HQ
celestar
parents:
3385
diff
changeset
|
163 |
|
c802170b5dd4
(svn r4196) -Codechange: Add and make use of an accessor that modifies the size of the Company HQ
celestar
parents:
3385
diff
changeset
|
164 |
|
6308 | 165 |
/** |
166 |
* Make an Unmovable tile. |
|
167 |
* @note do not use this function directly. Use one of the other Make* functions. |
|
168 |
* @param t the tile to make unmovable. |
|
169 |
* @param u the unmovable type of the tile. |
|
170 |
* @param o the new owner of the tile. |
|
171 |
*/ |
|
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
172 |
static inline void MakeUnmovable(TileIndex t, UnmovableType u, Owner o) |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
173 |
{ |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
174 |
SetTileType(t, MP_UNMOVABLE); |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
175 |
SetTileOwner(t, o); |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
176 |
_m[t].m2 = 0; |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
177 |
_m[t].m3 = 0; |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
178 |
_m[t].m4 = 0; |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
179 |
_m[t].m5 = u; |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
180 |
} |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
181 |
|
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
182 |
|
6308 | 183 |
/** |
184 |
* Make a transmitter tile. |
|
185 |
* @param t the tile to make a transmitter. |
|
186 |
*/ |
|
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
187 |
static inline void MakeTransmitter(TileIndex t) |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
188 |
{ |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
189 |
MakeUnmovable(t, UNMOVABLE_TRANSMITTER, OWNER_NONE); |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
190 |
} |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
191 |
|
6308 | 192 |
/** |
193 |
* Make a lighthouse tile. |
|
194 |
* @param t the tile to make a transmitter. |
|
195 |
*/ |
|
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
196 |
static inline void MakeLighthouse(TileIndex t) |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
197 |
{ |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
198 |
MakeUnmovable(t, UNMOVABLE_LIGHTHOUSE, OWNER_NONE); |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
199 |
} |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
200 |
|
6308 | 201 |
/** |
202 |
* Make a statue tile. |
|
203 |
* @param t the tile to make a statue. |
|
204 |
* @param o the owner of the statue. |
|
205 |
* @param town_id the town the statue was built in. |
|
206 |
*/ |
|
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
207 |
static inline void MakeStatue(TileIndex t, Owner o, TownID town_id) |
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
208 |
{ |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
209 |
MakeUnmovable(t, UNMOVABLE_STATUE, o); |
6298
c30fe89622df
(svn r9119) [cpp_gui] -Sync with trunk (r9003:9100)
bjarni
parents:
5838
diff
changeset
|
210 |
_m[t].m2 = town_id; |
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
211 |
} |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
212 |
|
6308 | 213 |
/** |
214 |
* Make an 'owned land' tile. |
|
215 |
* @param t the tile to make an 'owned land' tile. |
|
216 |
* @param o the owner of the land. |
|
217 |
*/ |
|
3310
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
218 |
static inline void MakeOwnedLand(TileIndex t, Owner o) |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
219 |
{ |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
220 |
MakeUnmovable(t, UNMOVABLE_OWNED_LAND, o); |
7339b2b1e957
(svn r4073) Add functions to make and test for (most) unmovable tiles
tron
parents:
diff
changeset
|
221 |
} |
3385
41ebb01a92f2
(svn r4193) -Codechange: Add and make use of an accessor function to create company HQs
celestar
parents:
3369
diff
changeset
|
222 |
|
6308 | 223 |
/** |
224 |
* Make an HQ with the give tile as it's northern tile. |
|
225 |
* @param t the tile to make the northern tile of a HQ. |
|
226 |
* @param o the owner of the HQ. |
|
227 |
*/ |
|
3385
41ebb01a92f2
(svn r4193) -Codechange: Add and make use of an accessor function to create company HQs
celestar
parents:
3369
diff
changeset
|
228 |
static inline void MakeCompanyHQ(TileIndex t, Owner o) |
41ebb01a92f2
(svn r4193) -Codechange: Add and make use of an accessor function to create company HQs
celestar
parents:
3369
diff
changeset
|
229 |
{ |
41ebb01a92f2
(svn r4193) -Codechange: Add and make use of an accessor function to create company HQs
celestar
parents:
3369
diff
changeset
|
230 |
MakeUnmovable(t + TileDiffXY(0, 0), UNMOVABLE_HQ_NORTH, o); |
41ebb01a92f2
(svn r4193) -Codechange: Add and make use of an accessor function to create company HQs
celestar
parents:
3369
diff
changeset
|
231 |
MakeUnmovable(t + TileDiffXY(0, 1), UNMOVABLE_HQ_WEST, o); |
41ebb01a92f2
(svn r4193) -Codechange: Add and make use of an accessor function to create company HQs
celestar
parents:
3369
diff
changeset
|
232 |
MakeUnmovable(t + TileDiffXY(1, 0), UNMOVABLE_HQ_EAST, o); |
41ebb01a92f2
(svn r4193) -Codechange: Add and make use of an accessor function to create company HQs
celestar
parents:
3369
diff
changeset
|
233 |
MakeUnmovable(t + TileDiffXY(1, 1), UNMOVABLE_HQ_SOUTH, o); |
41ebb01a92f2
(svn r4193) -Codechange: Add and make use of an accessor function to create company HQs
celestar
parents:
3369
diff
changeset
|
234 |
} |
4666
850b5b6e4bac
(svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents:
3971
diff
changeset
|
235 |
|
850b5b6e4bac
(svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents:
3971
diff
changeset
|
236 |
#endif /* UNMOVABLE_MAP_H */ |