Add: New RoadType API functions.

This commit is contained in:
peter1138
2019-04-06 20:50:00 +01:00
committed by Michael Lutz
parent c02ef3e456
commit 3293f08e0b
24 changed files with 231 additions and 2 deletions

View File

@@ -13,6 +13,7 @@
#define SCRIPT_ROAD_HPP
#include "script_tile.hpp"
#include "../../../road.h"
/**
* Class that handles all road related functions.
@@ -58,6 +59,14 @@ public:
ROADTYPE_INVALID = -1, ///< Invalid RoadType.
};
/**
* Road/tram types
*/
enum RoadTramTypes {
ROADTRAMTYPES_ROAD = ::RTTB_ROAD, ///< Road road types.
ROADTRAMTYPES_TRAM = ::RTTB_TRAM, ///< Tram road types.
};
/**
* Type of road station.
*/
@@ -537,6 +546,13 @@ public:
*/
static Money GetBuildCost(RoadType roadtype, BuildType build_type);
/**
* Test if a road type is for road or trams.
* @param roadtype the roadtype to test.
* @return RoadTramTypes of the road types.
*/
static RoadTramTypes GetRoadTramType(RoadType roadtype);
/**
* Get the maximum speed of road vehicles running on this roadtype.
* @param road_type The roadtype to get the maximum speed of.