Fix some daylength issues, possible division by zero in main menu.
[openttd-joker.git] / src / script / api / script_road.hpp
blobefece1b62f5e5d8e40b929b4c9a14be4a7a85038
1 /* $Id: script_road.hpp 26149 2013-12-08 15:44:09Z frosch $ */
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
10 /** @file script_road.hpp Everything to query and build roads. */
12 #ifndef SCRIPT_ROAD_HPP
13 #define SCRIPT_ROAD_HPP
15 #include "script_tile.hpp"
17 /**
18 * Class that handles all road related functions.
19 * @api ai game
21 class ScriptRoad : public ScriptObject {
22 public:
23 /**
24 * All road related error messages.
26 enum ErrorMessages {
27 /** Base for road building / maintaining errors */
28 ERR_ROAD_BASE = ScriptError::ERR_CAT_ROAD << ScriptError::ERR_CAT_BIT_SIZE,
30 /** Road works are in progress */
31 ERR_ROAD_WORKS_IN_PROGRESS, // [STR_ERROR_ROAD_WORKS_IN_PROGRESS]
33 /** Drive through is in the wrong direction */
34 ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION, // [STR_ERROR_DRIVE_THROUGH_DIRECTION]
36 /** Drive through roads can't be build on town owned roads */
37 ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD, // [STR_ERROR_DRIVE_THROUGH_ON_TOWN_ROAD]
40 /** One way roads can't have junctions */
41 ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS, // [STR_ERROR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION]
44 /**
45 * Types of road known to the game.
47 enum RoadType {
48 /* Note: these values represent part of the in-game RoadType enum */
49 ROADTYPE_ROAD = ::ROADTYPE_ROAD, ///< Build road objects.
50 ROADTYPE_TRAM = ::ROADTYPE_TRAM, ///< Build tram objects.
52 /* Custom added value, only valid for this API */
53 ROADTYPE_INVALID = -1, ///< Invalid RoadType.
56 /**
57 * Type of road station.
59 enum RoadVehicleType {
60 ROADVEHTYPE_BUS, ///< Build objects useable for busses and passenger trams
61 ROADVEHTYPE_TRUCK, ///< Build objects useable for trucks and cargo trams
64 /**
65 * Types of road-related objects in the game.
67 enum BuildType {
68 BT_ROAD, ///< Build a piece of road
69 BT_DEPOT, ///< Build a road depot
70 BT_BUS_STOP, ///< Build a bus stop
71 BT_TRUCK_STOP, ///< Build a truck stop
74 /**
75 * Determines whether a busstop or a truckstop is needed to transport a certain cargo.
76 * @param cargo_type The cargo to test.
77 * @pre ScriptCargo::IsValidCargo(cargo_type).
78 * @return The road vehicle type needed to transport the cargo.
80 static RoadVehicleType GetRoadVehicleTypeForCargo(CargoID cargo_type);
82 /**
83 * Checks whether the given tile is actually a tile with road that can be
84 * used to traverse a tile. This excludes road depots and 'normal' road
85 * stations, but includes drive through stations.
86 * @param tile The tile to check.
87 * @pre ScriptMap::IsValidTile(tile).
88 * @return True if and only if the tile has road.
90 static bool IsRoadTile(TileIndex tile);
92 /**
93 * Checks whether the given tile is actually a tile with a road depot.
94 * @param tile The tile to check.
95 * @pre ScriptMap::IsValidTile(tile).
96 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
97 * @return True if and only if the tile has a road depot.
99 static bool IsRoadDepotTile(TileIndex tile);
102 * Checks whether the given tile is actually a tile with a road station.
103 * @param tile The tile to check.
104 * @pre ScriptMap::IsValidTile(tile).
105 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
106 * @return True if and only if the tile has a road station.
108 static bool IsRoadStationTile(TileIndex tile);
111 * Checks whether the given tile is actually a tile with a drive through
112 * road station.
113 * @param tile The tile to check.
114 * @pre ScriptMap::IsValidTile(tile).
115 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
116 * @return True if and only if the tile has a drive through road station.
118 static bool IsDriveThroughRoadStationTile(TileIndex tile);
121 * Check if a given RoadType is available.
122 * @param road_type The RoadType to check for.
123 * @game @pre Valid ScriptCompanyMode active in scope.
124 * @return True if this RoadType can be used.
126 static bool IsRoadTypeAvailable(RoadType road_type);
129 * Get the current RoadType set for all ScriptRoad functions.
130 * @return The RoadType currently set.
132 static RoadType GetCurrentRoadType();
135 * Set the RoadType for all further ScriptRoad functions.
136 * @param road_type The RoadType to set.
138 static void SetCurrentRoadType(RoadType road_type);
141 * Check if a given tile has RoadType.
142 * @param tile The tile to check.
143 * @param road_type The RoadType to check for.
144 * @pre ScriptMap::IsValidTile(tile).
145 * @pre IsRoadTypeAvailable(road_type).
146 * @return True if the tile contains a RoadType object.
148 static bool HasRoadType(TileIndex tile, RoadType road_type);
151 * Checks whether the given tiles are directly connected, i.e. whether
152 * a road vehicle can travel from the center of the first tile to the
153 * center of the second tile.
154 * @param tile_from The source tile.
155 * @param tile_to The destination tile.
156 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
157 * @pre ScriptMap::IsValidTile(tile_from).
158 * @pre ScriptMap::IsValidTile(tile_to).
159 * @pre 'tile_from' and 'tile_to' are directly neighbouring tiles.
160 * @return True if and only if a road vehicle can go from tile_from to tile_to.
162 static bool AreRoadTilesConnected(TileIndex tile_from, TileIndex tile_to);
165 * Lookup function for building road parts independend on whether the
166 * "building on slopes" setting is enabled or not.
167 * This implementation can be used for abstract reasoning about a tile as
168 * it needs the slope and existing road parts of the tile as information.
169 * @param slope The slope of the tile to examine.
170 * @param existing An array with the existing neighbours in the same format
171 * as "start" and "end", e.g. ScriptMap.GetTileIndex(0, 1).
172 * As a result of this all values of the existing array
173 * must be of type integer.
174 * @param start The tile from where the 'tile to be considered' will be
175 * entered. This is a relative tile, so valid parameters are:
176 * ScriptMap.GetTileIndex(0, 1), ScriptMap.GetTileIndex(0, -1),
177 * ScriptMap.GetTileIndex(1, 0) and ScriptMap.GetTileIndex(-1, 0).
178 * @param end The tile from where the 'tile to be considered' will be
179 * exited. This is a relative tile, sovalid parameters are:
180 * ScriptMap.GetTileIndex(0, 1), ScriptMap.GetTileIndex(0, -1),
181 * ScriptMap.GetTileIndex(1, 0) and ScriptMap.GetTileIndex(-1, 0).
182 * @pre start != end.
183 * @pre slope must be a valid slope, i.e. one specified in ScriptTile::Slope.
184 * @note Passing data that would be invalid in-game, e.g. existing containing
185 * road parts that can not be build on a tile with the given slope,
186 * does not necessarily means that -1 is returned, i.e. not all
187 * preconditions written here or assumed by the game are extensively
188 * checked to make sure the data entered is valid.
189 * @return 0 when the build parts do not connect, 1 when they do connect once
190 * they are build or 2 when building the first part automatically
191 * builds the second part. -1 means the preconditions are not met.
193 static int32 CanBuildConnectedRoadParts(ScriptTile::Slope slope, struct Array *existing, TileIndex start, TileIndex end);
196 * Lookup function for building road parts independend on whether the
197 * "building on slopes" setting is enabled or not.
198 * This implementation can be used for reasoning about an existing tile.
199 * @param tile The the tile to examine.
200 * @param start The tile from where "tile" will be entered.
201 * @param end The tile from where "tile" will be exited.
202 * @pre start != end.
203 * @pre tile != start.
204 * @pre tile != end.
205 * @pre ScriptMap.IsValidTile(tile).
206 * @pre ScriptMap.IsValidTile(start).
207 * @pre ScriptMap.IsValidTile(end).
208 * @pre ScriptMap.GetDistanceManhattanToTile(tile, start) == 1.
209 * @pre ScriptMap.GetDistanceManhattanToTile(tile, end) == 1.
210 * @return 0 when the build parts do not connect, 1 when they do connect once
211 * they are build or 2 when building the first part automatically
212 * builds the second part. -1 means the preconditions are not met.
214 static int32 CanBuildConnectedRoadPartsHere(TileIndex tile, TileIndex start, TileIndex end);
217 * Count how many neighbours are road.
218 * @param tile The tile to check on.
219 * @pre ScriptMap::IsValidTile(tile).
220 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
221 * @return 0 means no neighbour road; max value is 4.
223 static int32 GetNeighbourRoadCount(TileIndex tile);
226 * Gets the tile in front of a road depot.
227 * @param depot The road depot tile.
228 * @pre IsRoadDepotTile(depot).
229 * @return The tile in front of the depot.
231 static TileIndex GetRoadDepotFrontTile(TileIndex depot);
234 * Gets the tile in front of a road station.
235 * @param station The road station tile.
236 * @pre IsRoadStationTile(station).
237 * @return The tile in front of the road station.
239 static TileIndex GetRoadStationFrontTile(TileIndex station);
242 * Gets the tile at the back of a drive through road station.
243 * So, one side of the drive through station is retrieved with
244 * GetTileInFrontOfStation, the other with this function.
245 * @param station The road station tile.
246 * @pre IsDriveThroughRoadStationTile(station).
247 * @return The tile at the back of the drive through road station.
249 static TileIndex GetDriveThroughBackTile(TileIndex station);
252 * Builds a road from the center of tile start to the center of tile end.
253 * @param start The start tile of the road.
254 * @param end The end tile of the road.
255 * @pre 'start' is not equal to 'end'.
256 * @pre ScriptMap::IsValidTile(start).
257 * @pre ScriptMap::IsValidTile(end).
258 * @pre 'start' and 'end' are in a straight line, i.e.
259 * ScriptMap::GetTileX(start) == ScriptMap::GetTileX(end) or
260 * ScriptMap::GetTileY(start) == ScriptMap::GetTileY(end).
261 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
262 * @exception ScriptError::ERR_ALREADY_BUILT
263 * @exception ScriptError::ERR_LAND_SLOPED_WRONG
264 * @exception ScriptError::ERR_AREA_NOT_CLEAR
265 * @exception ScriptRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS
266 * @exception ScriptRoad::ERR_ROAD_WORKS_IN_PROGRESS
267 * @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
268 * @note Construction will fail if an obstacle is found between the start and end tiles.
269 * @game @note Building a piece of road (without CompanyMode) results in a piece of road owned by towns.
270 * @return Whether the road has been/can be build or not.
272 static bool BuildRoad(TileIndex start, TileIndex end);
275 * Builds a one-way road from the center of tile start to the center
276 * of tile end. If the road already exists, it is made one-way road.
277 * If the road already exists and is already one-way in this direction,
278 * the road is made two-way again. If the road already exists but is
279 * one-way in the other direction, it's made a 'no'-way road (it's
280 * forbidden to enter the tile from any direction).
281 * @param start The start tile of the road.
282 * @param end The end tile of the road.
283 * @pre 'start' is not equal to 'end'.
284 * @pre ScriptMap::IsValidTile(start).
285 * @pre ScriptMap::IsValidTile(end).
286 * @pre 'start' and 'end' are in a straight line, i.e.
287 * ScriptMap::GetTileX(start) == ScriptMap::GetTileX(end) or
288 * ScriptMap::GetTileY(start) == ScriptMap::GetTileY(end).
289 * @pre GetCurrentRoadType() == ROADTYPE_ROAD.
290 * @game @pre Valid ScriptCompanyMode active in scope.
291 * @exception ScriptError::ERR_ALREADY_BUILT
292 * @exception ScriptError::ERR_LAND_SLOPED_WRONG
293 * @exception ScriptError::ERR_AREA_NOT_CLEAR
294 * @exception ScriptRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS
295 * @exception ScriptRoad::ERR_ROAD_WORKS_IN_PROGRESS
296 * @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
297 * @note Construction will fail if an obstacle is found between the start and end tiles.
298 * @return Whether the road has been/can be build or not.
300 static bool BuildOneWayRoad(TileIndex start, TileIndex end);
303 * Builds a road from the edge of tile start to the edge of tile end (both
304 * included).
305 * @param start The start tile of the road.
306 * @param end The end tile of the road.
307 * @pre 'start' is not equal to 'end'.
308 * @pre ScriptMap::IsValidTile(start).
309 * @pre ScriptMap::IsValidTile(end).
310 * @pre 'start' and 'end' are in a straight line, i.e.
311 * ScriptMap::GetTileX(start) == ScriptMap::GetTileX(end) or
312 * ScriptMap::GetTileY(start) == ScriptMap::GetTileY(end).
313 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
314 * @exception ScriptError::ERR_ALREADY_BUILT
315 * @exception ScriptError::ERR_LAND_SLOPED_WRONG
316 * @exception ScriptError::ERR_AREA_NOT_CLEAR
317 * @exception ScriptRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS
318 * @exception ScriptRoad::ERR_ROAD_WORKS_IN_PROGRESS
319 * @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
320 * @note Construction will fail if an obstacle is found between the start and end tiles.
321 * @game @note Building a piece of road (without CompanyMode) results in a piece of road owned by towns.
322 * @return Whether the road has been/can be build or not.
324 static bool BuildRoadFull(TileIndex start, TileIndex end);
327 * Builds a one-way road from the edge of tile start to the edge of tile end
328 * (both included). If the road already exists, it is made one-way road.
329 * If the road already exists and is already one-way in this direction,
330 * the road is made two-way again. If the road already exists but is
331 * one-way in the other direction, it's made a 'no'-way road (it's
332 * forbidden to enter the tile from any direction).
333 * @param start The start tile of the road.
334 * @param start The start tile of the road.
335 * @param end The end tile of the road.
336 * @pre 'start' is not equal to 'end'.
337 * @pre ScriptMap::IsValidTile(start).
338 * @pre ScriptMap::IsValidTile(end).
339 * @pre 'start' and 'end' are in a straight line, i.e.
340 * ScriptMap::GetTileX(start) == ScriptMap::GetTileX(end) or
341 * ScriptMap::GetTileY(start) == ScriptMap::GetTileY(end).
342 * @pre GetCurrentRoadType() == ROADTYPE_ROAD.
343 * @game @pre Valid ScriptCompanyMode active in scope.
344 * @exception ScriptError::ERR_ALREADY_BUILT
345 * @exception ScriptError::ERR_LAND_SLOPED_WRONG
346 * @exception ScriptError::ERR_AREA_NOT_CLEAR
347 * @exception ScriptRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS
348 * @exception ScriptRoad::ERR_ROAD_WORKS_IN_PROGRESS
349 * @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
350 * @note Construction will fail if an obstacle is found between the start and end tiles.
351 * @return Whether the road has been/can be build or not.
353 static bool BuildOneWayRoadFull(TileIndex start, TileIndex end);
356 * Builds a road depot.
357 * @param tile Place to build the depot.
358 * @param front The tile exactly in front of the depot.
359 * @pre ScriptMap::IsValidTile(tile).
360 * @pre ScriptMap::IsValidTile(front).
361 * @pre 'tile' is not equal to 'front', but in a straight line of it.
362 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
363 * @game @pre Valid ScriptCompanyMode active in scope.
364 * @exception ScriptError::ERR_FLAT_LAND_REQUIRED
365 * @exception ScriptError::ERR_AREA_NOT_CLEAR
366 * @return Whether the road depot has been/can be build or not.
368 static bool BuildRoadDepot(TileIndex tile, TileIndex front);
371 * Builds a road bus or truck station.
372 * @param tile Place to build the station.
373 * @param front The tile exactly in front of the station.
374 * @param road_veh_type Whether to build a truck or bus station.
375 * @param station_id The station to join, ScriptStation::STATION_NEW or ScriptStation::STATION_JOIN_ADJACENT.
376 * @pre ScriptMap::IsValidTile(tile).
377 * @pre ScriptMap::IsValidTile(front).
378 * @pre 'tile' is not equal to 'front', but in a straight line of it.
379 * @pre station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id).
380 * @pre GetCurrentRoadType() == ROADTYPE_ROAD.
381 * @game @pre Valid ScriptCompanyMode active in scope.
382 * @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
383 * @exception ScriptError::ERR_AREA_NOT_CLEAR
384 * @exception ScriptError::ERR_FLAT_LAND_REQUIRED
385 * @exception ScriptRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION
386 * @exception ScriptRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD
387 * @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
388 * @exception ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
389 * @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
390 * @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
391 * @return Whether the station has been/can be build or not.
393 static bool BuildRoadStation(TileIndex tile, TileIndex front, RoadVehicleType road_veh_type, StationID station_id);
396 * Builds a drive-through road bus or truck station.
397 * @param tile Place to build the station.
398 * @param front A tile on the same axis with 'tile' as the station shall be oriented.
399 * @param road_veh_type Whether to build a truck or bus station.
400 * @param station_id The station to join, ScriptStation::STATION_NEW or ScriptStation::STATION_JOIN_ADJACENT.
401 * @pre ScriptMap::IsValidTile(tile).
402 * @pre ScriptMap::IsValidTile(front).
403 * @pre 'tile' is not equal to 'front', but in a straight line of it.
404 * @pre station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id).
405 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
406 * @game @pre Valid ScriptCompanyMode active in scope.
407 * @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
408 * @exception ScriptError::ERR_AREA_NOT_CLEAR
409 * @exception ScriptError::ERR_FLAT_LAND_REQUIRED
410 * @exception ScriptRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION
411 * @exception ScriptRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD
412 * @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
413 * @exception ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
414 * @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
415 * @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
416 * @return Whether the station has been/can be build or not.
418 static bool BuildDriveThroughRoadStation(TileIndex tile, TileIndex front, RoadVehicleType road_veh_type, StationID station_id);
421 * Removes a road from the center of tile start to the center of tile end.
422 * @param start The start tile of the road.
423 * @param end The end tile of the road.
424 * @pre 'start' is not equal to 'end'.
425 * @pre ScriptMap::IsValidTile(start).
426 * @pre ScriptMap::IsValidTile(end).
427 * @pre 'start' and 'end' are in a straight line, i.e.
428 * ScriptMap::GetTileX(start) == ScriptMap::GetTileX(end) or
429 * ScriptMap::GetTileY(start) == ScriptMap::GetTileY(end).
430 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
431 * @game @pre Valid ScriptCompanyMode active in scope.
432 * @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
433 * @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
434 * @exception ScriptRoad::ERR_ROAD_WORKS_IN_PROGRESS
435 * @return Whether the road has been/can be removed or not.
437 static bool RemoveRoad(TileIndex start, TileIndex end);
440 * Removes a road from the edge of tile start to the edge of tile end (both
441 * included).
442 * @param start The start tile of the road.
443 * @param end The end tile of the road.
444 * @pre 'start' is not equal to 'end'.
445 * @pre ScriptMap::IsValidTile(start).
446 * @pre ScriptMap::IsValidTile(end).
447 * @pre 'start' and 'end' are in a straight line, i.e.
448 * ScriptMap::GetTileX(start) == ScriptMap::GetTileX(end) or
449 * ScriptMap::GetTileY(start) == ScriptMap::GetTileY(end).
450 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
451 * @game @pre Valid ScriptCompanyMode active in scope.
452 * @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
453 * @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
454 * @exception ScriptRoad::ERR_ROAD_WORKS_IN_PROGRESS
455 * @return Whether the road has been/can be removed or not.
457 static bool RemoveRoadFull(TileIndex start, TileIndex end);
460 * Removes a road depot.
461 * @param tile Place to remove the depot from.
462 * @pre ScriptMap::IsValidTile(tile).
463 * @pre Tile is a road depot.
464 * @game @pre Valid ScriptCompanyMode active in scope.
465 * @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
466 * @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
467 * @return Whether the road depot has been/can be removed or not.
469 static bool RemoveRoadDepot(TileIndex tile);
472 * Removes a road bus or truck station.
473 * @param tile Place to remove the station from.
474 * @pre ScriptMap::IsValidTile(tile).
475 * @pre Tile is a road station.
476 * @game @pre Valid ScriptCompanyMode active in scope.
477 * @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
478 * @exception ScriptError::ERR_VEHICLE_IN_THE_WAY
479 * @return Whether the station has been/can be removed or not.
481 static bool RemoveRoadStation(TileIndex tile);
484 * Get the baseprice of building a road-related object.
485 * @param roadtype the roadtype that is build (on)
486 * @param build_type the type of object to build
487 * @pre IsRoadTypeAvailable(railtype)
488 * @return The baseprice of building the given object.
490 static Money GetBuildCost(RoadType roadtype, BuildType build_type);
493 * Get the maintenance cost factor of a roadtype.
494 * @param roadtype The roadtype to get the maintenance factor of.
495 * @pre IsRoadTypeAvailable(roadtype)
496 * @return Maintenance cost factor of the roadtype.
498 static uint16 GetMaintenanceCostFactor(RoadType roadtype);
500 private:
503 * Internal function used by Build(OneWay)Road(Full).
505 static bool _BuildRoadInternal(TileIndex start, TileIndex end, bool one_way, bool full);
508 * Internal function used by Build(DriveThrough)RoadStation.
510 static bool _BuildRoadStationInternal(TileIndex tile, TileIndex front, RoadVehicleType road_veh_type, bool drive_through, StationID station_id);
513 #endif /* SCRIPT_ROAD_HPP */