diff options
author | yexo <yexo@openttd.org> | 2009-07-31 22:30:54 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-07-31 22:30:54 +0000 |
commit | 8c05194c0241d88226ba6c727a0c45b00d8495ed (patch) | |
tree | be76ebd36a14a7828a9ed5400f42045b375b7c50 /src/ai/api/ai_waypoint.hpp | |
parent | b129184d57cac186c53bda3e8165efd63806c2aa (diff) | |
download | openttd-8c05194c0241d88226ba6c727a0c45b00d8495ed.tar.xz |
(svn r17011) -Change [NoAI]: Add AIBaseStation as a parentclass for AIStation and AIWaypoint, and move GetName, SetName and GetLocation to AIBaseStation
Remove (nearly) all references to WaypointID and replace them with StationID
Diffstat (limited to 'src/ai/api/ai_waypoint.hpp')
-rw-r--r-- | src/ai/api/ai_waypoint.hpp | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/src/ai/api/ai_waypoint.hpp b/src/ai/api/ai_waypoint.hpp index 6762eb8f6..6bc8fd212 100644 --- a/src/ai/api/ai_waypoint.hpp +++ b/src/ai/api/ai_waypoint.hpp @@ -7,63 +7,29 @@ #include "ai_object.hpp" #include "ai_error.hpp" +#include "ai_basestation.hpp" /** * Class that handles all waypoint related functions. */ -class AIWaypoint : public AIObject { +class AIWaypoint : public AIBaseStation { public: static const char *GetClassName() { return "AIWaypoint"; } /** - * Special waypoint IDs signalling different kinds of waypoints. - */ - enum SpecialWaypointIDs { - WAYPOINT_INVALID = 0xFFFF, //!< An invalid WaypointID. - }; - - /** * 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. */ - static bool IsValidWaypoint(WaypointID waypoint_id); + static bool IsValidWaypoint(StationID waypoint_id); /** - * Get the WaypointID of a tile. - * @param tile The tile to find the WaypointID of. + * Get the StationID of a tile. + * @param tile The tile to find the StationID of. * @pre AIRail::IsRailWaypointTile(tile). - * @return WaypointID of the waypoint. - */ - static WaypointID GetWaypointID(TileIndex tile); - - /** - * Get the name of a waypoint. - * @param waypoint_id The waypoint to get the name of. - * @pre IsValidWaypoint(waypoint_id). - * @return The name of the waypoint. - */ - static char *GetName(WaypointID waypoint_id); - - /** - * Set the name this waypoint. - * @param waypoint_id The waypoint to set the name of. - * @param name The new name of the waypoint. - * @pre IsValidWaypointwaypoint_id). - * @pre 'name' must have at least one character. - * @pre 'name' must have at most 30 characters. - * @exception AIError::ERR_NAME_IS_NOT_UNIQUE - * @return True if the name was changed. - */ - static bool SetName(WaypointID waypoint_id, const char *name); - - /** - * Get the current location of a waypoint. - * @param waypoint_id The waypoint to get the location of. - * @pre IsValidWaypoint(waypoint_id). - * @return The tile the waypoint is currently on. + * @return StationID of the waypoint. */ - static TileIndex GetLocation(WaypointID waypoint_id); + static StationID GetWaypointID(TileIndex tile); }; #endif /* AI_WAYPOINT_HPP */ |