author | peter1138 |
Sun, 03 Aug 2008 17:35:08 +0000 | |
changeset 9834 | 7474149531c1 |
parent 9784 | a9cc0dff1667 |
permissions | -rw-r--r-- |
8083
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
1 |
/* $Id$ */ |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
2 |
|
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
3 |
/** @file tunnelbridge_map.h Functions that have tunnels and bridges in common */ |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
4 |
|
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
5 |
#ifndef TUNNELBRIDGE_MAP_H |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
6 |
#define TUNNELBRIDGE_MAP_H |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
7 |
|
8100
6bc08f98ec16
(svn r11661) -Codechange: some header reworks in order to try to reduce the compile time of OpenTTD by reduce the amount of circular-ish dependencies.
rubidium
parents:
8083
diff
changeset
|
8 |
#include "direction_func.h" |
8139
4e91c448c409
(svn r11701) -Codechange: removal unnecessary inclusions of map.h (and split map.h).
rubidium
parents:
8108
diff
changeset
|
9 |
#include "core/bitmath_func.hpp" |
4e91c448c409
(svn r11701) -Codechange: removal unnecessary inclusions of map.h (and split map.h).
rubidium
parents:
8108
diff
changeset
|
10 |
#include "tile_map.h" |
8197
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
11 |
#include "bridge_map.h" |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
12 |
#include "tunnel_map.h" |
9126
5648d696456b
(svn r12986) -Codechange: move the landscape and transport related types from openttd.h to their own headers.
rubidium
parents:
8481
diff
changeset
|
13 |
#include "transport_type.h" |
9784
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
14 |
#include "track_func.h" |
8083
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
15 |
|
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
16 |
|
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
17 |
/** |
8481
b12960a2e770
(svn r12056) -Fix [FS#1704]: Enable YAPF to start searching inside a wormhole.
frosch
parents:
8197
diff
changeset
|
18 |
* Get the direction pointing to the other end. |
b12960a2e770
(svn r12056) -Fix [FS#1704]: Enable YAPF to start searching inside a wormhole.
frosch
parents:
8197
diff
changeset
|
19 |
* |
b12960a2e770
(svn r12056) -Fix [FS#1704]: Enable YAPF to start searching inside a wormhole.
frosch
parents:
8197
diff
changeset
|
20 |
* Tunnel: Get the direction facing into the tunnel |
8083
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
21 |
* Bridge: Get the direction pointing onto the bridge |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
22 |
* @param t The tile to analyze |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
23 |
* @pre IsTileType(t, MP_TUNNELBRIDGE) |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
24 |
* @return the above mentionned direction |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
25 |
*/ |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
26 |
static inline DiagDirection GetTunnelBridgeDirection(TileIndex t) |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
27 |
{ |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
28 |
assert(IsTileType(t, MP_TUNNELBRIDGE)); |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
29 |
return (DiagDirection)GB(_m[t].m5, 0, 2); |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
30 |
} |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
31 |
|
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
32 |
/** |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
33 |
* Tunnel: Get the transport type of the tunnel (road or rail) |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
34 |
* Bridge: Get the transport type of the bridge's ramp |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
35 |
* @param t The tile to analyze |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
36 |
* @pre IsTileType(t, MP_TUNNELBRIDGE) |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
37 |
* @return the transport type in the tunnel/bridge |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
38 |
*/ |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
39 |
static inline TransportType GetTunnelBridgeTransportType(TileIndex t) |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
40 |
{ |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
41 |
assert(IsTileType(t, MP_TUNNELBRIDGE)); |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
42 |
return (TransportType)GB(_m[t].m5, 2, 2); |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
43 |
} |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
44 |
|
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
45 |
/** |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
46 |
* Tunnel: Is this tunnel entrance in a snowy or desert area? |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
47 |
* Bridge: Does the bridge ramp lie in a snow or desert area? |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
48 |
* @param t The tile to analyze |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
49 |
* @pre IsTileType(t, MP_TUNNELBRIDGE) |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
50 |
* @return true if and only if the tile is in a snowy/desert area |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
51 |
*/ |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
52 |
static inline bool HasTunnelBridgeSnowOrDesert(TileIndex t) |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
53 |
{ |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
54 |
assert(IsTileType(t, MP_TUNNELBRIDGE)); |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
55 |
return HasBit(_m[t].m4, 7); |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
56 |
} |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
57 |
|
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
58 |
/** |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
59 |
* Tunnel: Places this tunnel entrance in a snowy or desert area, or takes it out of there. |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
60 |
* Bridge: Sets whether the bridge ramp lies in a snow or desert area. |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
61 |
* @param t the tunnel entrance / bridge ramp tile |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
62 |
* @param snow_or_desert is the entrance/ramp in snow or desert (true), when |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
63 |
* not in snow and not in desert false |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
64 |
* @pre IsTileType(t, MP_TUNNELBRIDGE) |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
65 |
*/ |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
66 |
static inline void SetTunnelBridgeSnowOrDesert(TileIndex t, bool snow_or_desert) |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
67 |
{ |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
68 |
assert(IsTileType(t, MP_TUNNELBRIDGE)); |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
69 |
SB(_m[t].m4, 7, 1, snow_or_desert); |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
70 |
} |
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
71 |
|
8197
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
72 |
/** |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
73 |
* Determines type of the wormhole and returns its other end |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
74 |
* @param t one end |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
75 |
* @pre IsTileType(t, MP_TUNNELBRIDGE) |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
76 |
* @return other end |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
77 |
*/ |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
78 |
static inline TileIndex GetOtherTunnelBridgeEnd(TileIndex t) |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
79 |
{ |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
80 |
assert(IsTileType(t, MP_TUNNELBRIDGE)); |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
81 |
return IsTunnel(t) ? GetOtherTunnelEnd(t) : GetOtherBridgeEnd(t); |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
82 |
} |
3af783256580
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
smatz
parents:
8142
diff
changeset
|
83 |
|
9784
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
84 |
|
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
85 |
/** |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
86 |
* Get the reservation state of the rail tunnel/bridge |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
87 |
* @pre IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
88 |
* @param t the tile |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
89 |
* @return reservation state |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
90 |
*/ |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
91 |
static inline bool GetTunnelBridgeReservation(TileIndex t) |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
92 |
{ |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
93 |
assert(IsTileType(t, MP_TUNNELBRIDGE)); |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
94 |
assert(GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL); |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
95 |
return HasBit(_m[t].m5, 4); |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
96 |
} |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
97 |
|
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
98 |
/** |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
99 |
* Set the reservation state of the rail tunnel/bridge |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
100 |
* @pre IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
101 |
* @param t the tile |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
102 |
* @param b the reservation state |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
103 |
*/ |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
104 |
static inline void SetTunnelBridgeReservation(TileIndex t, bool b) |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
105 |
{ |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
106 |
assert(IsTileType(t, MP_TUNNELBRIDGE)); |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
107 |
assert(GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL); |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
108 |
SB(_m[t].m5, 4, 1, b ? 1 : 0); |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
109 |
} |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
110 |
|
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
111 |
/** |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
112 |
* Get the reserved track bits for a rail tunnel/bridge |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
113 |
* @pre IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
114 |
* @param t the tile |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
115 |
* @return reserved track bits |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
116 |
*/ |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
117 |
static inline TrackBits GetRailTunnelBridgeReservation(TileIndex t) |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
118 |
{ |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
119 |
return GetTunnelBridgeReservation(t) ? DiagDirToDiagTrackBits(GetTunnelBridgeDirection(t)) : TRACK_BIT_NONE; |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
120 |
} |
a9cc0dff1667
(svn r13926) -Add [YAPP]: Add map accessors for path reservations. (michi_cc)
rubidium
parents:
9126
diff
changeset
|
121 |
|
8083
ad22eade501f
(svn r11644) -Codechange: merge some functions from tunnel_map.h and bridge_map.h into tunnelbridge_map.h
smatz
parents:
diff
changeset
|
122 |
#endif /* TUNNELBRIDGE_MAP_H */ |