author | bjarni |
Thu, 30 Mar 2006 20:14:06 +0000 | |
changeset 3380 | 2d02cfdf6d14 |
parent 3377 | 608cf1405409 |
child 3382 | be14efb0dfd7 |
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 |
|
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
3 |
#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
|
4 |
|
3377
608cf1405409
(svn r4179) -Codechange: Add and make use of an accessor that obtains the building type
celestar
parents:
3369
diff
changeset
|
5 |
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
|
6 |
{ |
608cf1405409
(svn r4179) -Codechange: Add and make use of an accessor that obtains the building type
celestar
parents:
3369
diff
changeset
|
7 |
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
|
8 |
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
|
9 |
} |
3319
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
10 |
|
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
11 |
static inline uint GetTownIndex(TileIndex t) |
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
12 |
{ |
3369
cab209754317
(svn r4166) Sprinkle several map accessors with assert()s
tron
parents:
3319
diff
changeset
|
13 |
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
|
14 |
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
|
15 |
} |
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
16 |
|
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
17 |
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
|
18 |
{ |
16c0f06829a5
(svn r4085) Add GetTown{Index,ByTile}() to get the town index resp. the town from a tile
tron
parents:
diff
changeset
|
19 |
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
|
20 |
} |