summaryrefslogtreecommitdiff
path: root/src/script/api/script_waypoint.hpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-12-15 18:40:15 +0000
committerrubidium <rubidium@openttd.org>2011-12-15 18:40:15 +0000
commit18d929aa21f42f292fd249e6d5feb6bf71ba93ae (patch)
tree5a26d0c7d569a26381b3b3afa83afeac3e315763 /src/script/api/script_waypoint.hpp
parentbb564bc34dd5db62d994eac10f88a81979a0f89c (diff)
downloadopenttd-18d929aa21f42f292fd249e6d5feb6bf71ba93ae.tar.xz
(svn r23521) -Codechange: use the actual enum values from the 'core' in the API when they refer to the in-game values in the cases where that is possible and sensible
Diffstat (limited to 'src/script/api/script_waypoint.hpp')
-rw-r--r--src/script/api/script_waypoint.hpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/script/api/script_waypoint.hpp b/src/script/api/script_waypoint.hpp
index 645cc2daf..797501e7e 100644
--- a/src/script/api/script_waypoint.hpp
+++ b/src/script/api/script_waypoint.hpp
@@ -13,6 +13,7 @@
#define SCRIPT_WAYPOINT_HPP
#include "script_basestation.hpp"
+#include "../../station_type.h"
/**
* Class that handles all waypoint related functions.
@@ -21,16 +22,6 @@
class ScriptWaypoint : public ScriptBaseStation {
public:
/**
- * Type of waypoints known in the game.
- */
- enum WaypointType {
- /* Values are important, as they represent the internal state of the game. */
- WAYPOINT_RAIL = 0x01, ///< Rail waypoint
- WAYPOINT_BUOY = 0x10, ///< Buoy
- WAYPOINT_ANY = 0x11, ///< All waypoint types
- };
-
- /**
* All waypoint related error messages.
*/
enum ErrorMessages {
@@ -45,6 +36,16 @@ public:
};
/**
+ * Type of waypoints known in the game.
+ */
+ enum WaypointType {
+ /* Note: these values represent part of the in-game StationFacility enum */
+ WAYPOINT_RAIL = ::FACIL_TRAIN, ///< Rail waypoint
+ WAYPOINT_BUOY = ::FACIL_DOCK, ///< Buoy
+ WAYPOINT_ANY = WAYPOINT_RAIL | WAYPOINT_BUOY, ///< All waypoint types
+ };
+
+ /**
* Checks whether the given waypoint is valid and owned by you.
* @param waypoint_id The waypoint to check.
* @return True if and only if the waypoint is valid.