diff options
author | michi_cc <michi_cc@openttd.org> | 2011-12-13 00:43:59 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-12-13 00:43:59 +0000 |
commit | a085ea9e4b9078c647304e85d4c03980b71ced22 (patch) | |
tree | 0402e72db8caaf57ca38b3dd71312f9375eb389c /src/script/api/script_event_types.hpp | |
parent | 34ffd08a19e1156260223256d87a4cdfa7a080e0 (diff) | |
download | openttd-a085ea9e4b9078c647304e85d4c03980b71ced22.tar.xz |
(svn r23506) -Add: [NoAI] Support for dealing with aircraft range.
Diffstat (limited to 'src/script/api/script_event_types.hpp')
-rw-r--r-- | src/script/api/script_event_types.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/script/api/script_event_types.hpp b/src/script/api/script_event_types.hpp index ea25e6f12..dd8f08917 100644 --- a/src/script/api/script_event_types.hpp +++ b/src/script/api/script_event_types.hpp @@ -796,4 +796,37 @@ private: TownID town; ///< The town that got founded. }; +/** + * Event AircraftDestTooFar, indicating the next destination of an aircraft is too far away. + * This event can be trigger when the current oder of an aircraft changes, usually either when + * loading is done or when switch manually. + * @api ai + */ +class ScriptEventAircraftDestTooFar : public ScriptEvent { +public: + /** + * @param vehicle_id The aircraft whose destination is too far away. + */ + ScriptEventAircraftDestTooFar(VehicleID vehicle_id) : + ScriptEvent(ET_AIRCRAFT_DEST_TOO_FAR), + vehicle_id(vehicle_id) + {} + + /** + * Convert an ScriptEvent to the real instance. + * @param instance The instance to convert. + * @return The converted instance. + */ + static ScriptEventAircraftDestTooFar *Convert(ScriptEvent *instance) { return (ScriptEventAircraftDestTooFar *)instance; } + + /** + * Get the VehicleID of the aircraft whose destination is too far away. + * @return The VehicleID of the aircraft whose destination is too far away. + */ + VehicleID GetVehicleID() { return this->vehicle_id; } + +private: + VehicleID vehicle_id; ///< The vehicle aircraft whose destination is too far away. +}; + #endif /* SCRIPT_EVENT_TYPES_HPP */ |