AIEventVehicleCrashed Class Reference

Event Vehicle Crash, indicating a vehicle of yours is crashed. More...

Inheritance diagram for AIEventVehicleCrashed:

AIEvent

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 AIEventVehicleCrashedConvert (AIEvent *instance)
 Convert an AIEvent to the real instance.

Detailed Description

Event Vehicle Crash, indicating a vehicle of yours is crashed.

It contains the crash site, the crashed vehicle and the reason for the crash.


Member Enumeration Documentation

The reasons for vehicle crashes.

Enumerator:
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.


Constructor & Destructor Documentation

AIEventVehicleCrashed::AIEventVehicleCrashed ( VehicleID  vehicle,
TileIndex  crash_site,
CrashReason  crash_reason 
)

Parameters:
vehicle The vehicle that crashed.
crash_site Where the vehicle crashed.
crash_reason The reason why the vehicle crashed.


Member Function Documentation

static AIEventVehicleCrashed* AIEventVehicleCrashed::Convert ( AIEvent instance  )  [inline, static]

Convert an AIEvent to the real instance.

Parameters:
instance The instance to convert.
Returns:
The converted instance.

VehicleID AIEventVehicleCrashed::GetVehicleID (  )  [inline]

Get the VehicleID of the crashed vehicle.

Returns:
The crashed vehicle.

TileIndex AIEventVehicleCrashed::GetCrashSite (  )  [inline]

Find the tile the vehicle crashed.

Returns:
The crash site.

CrashReason AIEventVehicleCrashed::GetCrashReason (  )  [inline]

Get the reason for crashing.

Returns:
The reason for crashing


Generated on Thu Jun 30 21:53:52 2016 for OpenTTD NoAI API by  doxygen 1.5.6