#include <ai_event_types.hpp>
Public Types | |
enum | CrashReason { CRASH_TRAIN, CRASH_RV_LEVEL_CROSSING, CRASH_RV_UFO, CRASH_PLANE_LANDING, CRASH_AIRCRAFT_NO_AIRPORT, CRASH_FLOODED } |
The reasons for vehicle crashes. More... | |
Public Member Functions | |
AIEventVehicleCrashed (VehicleID vehicle, TileIndex crash_site, CrashReason crash_reason) | |
VehicleID | GetVehicleID () |
Get the VehicleID of the crashed vehicle. | |
TileIndex | GetCrashSite () |
Find the tile the vehicle crashed. | |
CrashReason | GetCrashReason () |
Get the reason for crashing. | |
Static Public Member Functions | |
static const char * | GetClassName () |
static AIEventVehicleCrashed * | Convert (AIEvent *instance) |
Convert an AIEvent to the real instance. | |
Private Attributes | |
TileIndex | crash_site |
VehicleID | vehicle |
CrashReason | crash_reason |
It contains the crash site, the crashed vehicle and the reason for the crash.
Definition at line 19 of file ai_event_types.hpp.
The reasons for vehicle crashes.
CRASH_TRAIN | Two trains collided. |
CRASH_RV_LEVEL_CROSSING | Road vehicle got under a train. |
CRASH_RV_UFO | Road vehicle got under a landing ufo. |
CRASH_PLANE_LANDING | Plane crashed on landing. |
CRASH_AIRCRAFT_NO_AIRPORT | Aircraft crashed after it found not a single airport for landing. |
CRASH_FLOODED | Vehicle was flooded. |
Definition at line 26 of file ai_event_types.hpp.
AIEventVehicleCrashed::AIEventVehicleCrashed | ( | VehicleID | vehicle, | |
TileIndex | crash_site, | |||
CrashReason | crash_reason | |||
) | [inline] |
vehicle | The vehicle that crashed. | |
crash_site | Where the vehicle crashed. | |
crash_reason | The reason why the vehicle crashed. |
Definition at line 40 of file ai_event_types.hpp.
static AIEventVehicleCrashed* AIEventVehicleCrashed::Convert | ( | AIEvent * | instance | ) | [inline, static] |
Convert an AIEvent to the real instance.
instance | The instance to convert. |
Definition at line 52 of file ai_event_types.hpp.
VehicleID AIEventVehicleCrashed::GetVehicleID | ( | ) | [inline] |
Get the VehicleID of the crashed vehicle.
Definition at line 58 of file ai_event_types.hpp.
TileIndex AIEventVehicleCrashed::GetCrashSite | ( | ) | [inline] |
Find the tile the vehicle crashed.
Definition at line 64 of file ai_event_types.hpp.
CrashReason AIEventVehicleCrashed::GetCrashReason | ( | ) | [inline] |
Get the reason for crashing.
Definition at line 70 of file ai_event_types.hpp.