author | tron |
Wed, 08 Mar 2006 19:47:18 +0000 | |
changeset 3168 | 34cfe6f61a12 |
parent 3156 | 028b6756b279 |
child 3184 | 7405329343ce |
permissions | -rw-r--r-- |
3154 | 1 |
/* $Id$ */ |
2 |
||
3 |
#ifndef TUNNEL_MAP_H |
|
4 |
#define TUNNEL_MAP_H |
|
5 |
||
6 |
#include "direction.h" |
|
7 |
#include "macros.h" |
|
8 |
#include "map.h" |
|
9 |
#include "rail.h" |
|
10 |
||
11 |
||
12 |
static inline DiagDirection GetTunnelDirection(TileIndex t) |
|
13 |
{ |
|
14 |
return (DiagDirection)GB(_m[t].m5, 0, 2); |
|
15 |
} |
|
16 |
||
17 |
||
18 |
static inline TransportType GetTunnelTransportType(TileIndex t) |
|
19 |
{ |
|
20 |
return (TransportType)GB(_m[t].m5, 2, 2); |
|
21 |
} |
|
22 |
||
23 |
||
24 |
TileIndex GetOtherTunnelEnd(TileIndex); |
|
3156
028b6756b279
(svn r3779) Move CheckTunnelInWay() to a more appropriate place, invert its result and give it a less ambiguous name (IsTunnelInWay)
tron
parents:
3154
diff
changeset
|
25 |
bool IsTunnelInWay(TileIndex, uint z); |
3154 | 26 |
|
27 |
||
28 |
static inline void MakeRoadTunnel(TileIndex t, Owner o, DiagDirection d) |
|
29 |
{ |
|
30 |
SetTileType(t, MP_TUNNELBRIDGE); |
|
31 |
SetTileOwner(t, o); |
|
32 |
_m[t].m2 = 0; |
|
33 |
_m[t].m3 = 0; |
|
34 |
_m[t].m4 = 0; |
|
35 |
_m[t].m5 = TRANSPORT_ROAD << 2 | d; |
|
36 |
} |
|
37 |
||
38 |
static inline void MakeRailTunnel(TileIndex t, Owner o, DiagDirection d, RailType r) |
|
39 |
{ |
|
40 |
SetTileType(t, MP_TUNNELBRIDGE); |
|
41 |
SetTileOwner(t, o); |
|
42 |
_m[t].m2 = 0; |
|
43 |
_m[t].m3 = r; |
|
44 |
_m[t].m4 = 0; |
|
45 |
_m[t].m5 = TRANSPORT_RAIL << 2 | d; |
|
46 |
} |
|
47 |
||
48 |
#endif |