summaryrefslogtreecommitdiff
path: root/src/script/api/script_engine.hpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2019-04-06 20:50:00 +0100
committerMichael Lutz <michi@icosahedron.de>2019-05-01 21:36:27 +0200
commit3293f08e0b1aa94319c29e7391eb2f5d6d4c5a17 (patch)
tree8e73e45a5aa7bcf8b97c69bce703f9b415ad1fda /src/script/api/script_engine.hpp
parentc02ef3e4564b7b54d49f0827d2d7625cbc38f335 (diff)
downloadopenttd-3293f08e0b1aa94319c29e7391eb2f5d6d4c5a17.tar.xz
Add: New RoadType API functions.
Diffstat (limited to 'src/script/api/script_engine.hpp')
-rw-r--r--src/script/api/script_engine.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/script/api/script_engine.hpp b/src/script/api/script_engine.hpp
index 173377742..b08b6f64b 100644
--- a/src/script/api/script_engine.hpp
+++ b/src/script/api/script_engine.hpp
@@ -218,6 +218,28 @@ public:
static bool HasPowerOnRail(EngineID engine_id, ScriptRail::RailType track_rail_type);
/**
+ * Check if a road vehicle can run on a RoadType.
+ * @param engine_id The engine to check.
+ * @param road_type Another RoadType.
+ * @pre IsValidEngine(engine_id).
+ * @pre GetVehicleType(engine_id) == ScriptVehicle::VT_ROAD.
+ * @pre ScriptRoad::IsRoadTypeAvailable(road_type).
+ * @return Whether an engine of type 'engine_id' can run on 'road_type'.
+ */
+ static bool CanRunOnRoad(EngineID engine_id, ScriptRoad::RoadType road_type);
+
+ /**
+ * Check if a road vehicle has power on a RoadType.
+ * @param engine_id The engine to check.
+ * @param road_type Another RoadType.
+ * @pre IsValidEngine(engine_id).
+ * @pre GetVehicleType(engine_id) == ScriptVehicle::VT_ROAD.
+ * @pre ScriptRoad::IsRoadTypeAvailable(road_type).
+ * @return Whether an engine of type 'engine_id' has power on 'road_type'.
+ */
+ static bool HasPowerOnRoad(EngineID engine_id, ScriptRoad::RoadType road_type);
+
+ /**
* Get the RoadType of the engine.
* @param engine_id The engine to get the RoadType of.
* @pre IsValidEngine(engine_id).