equal
deleted
inserted
replaced
6 #define ROAD_FUNC_H |
6 #define ROAD_FUNC_H |
7 |
7 |
8 #include "core/bitmath_func.hpp" |
8 #include "core/bitmath_func.hpp" |
9 #include "road_type.h" |
9 #include "road_type.h" |
10 #include "direction_func.h" |
10 #include "direction_func.h" |
|
11 #include "player_type.h" |
11 |
12 |
12 /** |
13 /** |
13 * Whether the given roadtype is valid. |
14 * Whether the given roadtype is valid. |
14 * @param rt the roadtype to check for validness |
15 * @param rt the roadtype to check for validness |
15 * @return true if and only if valid |
16 * @return true if and only if valid |
111 static inline RoadBits DiagDirToRoadBits(DiagDirection d) |
112 static inline RoadBits DiagDirToRoadBits(DiagDirection d) |
112 { |
113 { |
113 return (RoadBits)(ROAD_NW << (3 ^ d)); |
114 return (RoadBits)(ROAD_NW << (3 ^ d)); |
114 } |
115 } |
115 |
116 |
|
117 /** |
|
118 * Finds out, whether given player has all given RoadTypes available |
|
119 * @param PlayerID ID of player |
|
120 * @param rts RoadTypes to test |
|
121 * @return true if player has all requested RoadTypes available |
|
122 */ |
|
123 bool HasRoadTypesAvail(const PlayerID p, const RoadTypes rts); |
|
124 |
|
125 /** |
|
126 * Validate functions for rail building. |
|
127 * @param rt road type to check. |
|
128 * @return true if the current player may build the road. |
|
129 */ |
|
130 bool ValParamRoadType(const RoadType rt); |
|
131 |
|
132 /** |
|
133 * Get the road types the given player can build. |
|
134 * @param p the player to get the roadtypes for. |
|
135 * @return the road types. |
|
136 */ |
|
137 RoadTypes GetPlayerRoadtypes(const PlayerID p); |
|
138 |
|
139 void UpdateLevelCrossing(TileIndex tile, bool sound = true); |
|
140 |
116 #endif /* ROAD_FUNC_H */ |
141 #endif /* ROAD_FUNC_H */ |