#include <ai_event_types.hpp>
Public Member Functions | |
AIEventEnginePreview (EngineID engine) | |
char * | GetName () |
Get the name of the offered engine. | |
CargoID | GetCargoType () |
Get the cargo-type of the offered engine. | |
int32 | GetCapacity () |
Get the capacity of the offered engine. | |
int32 | GetMaxSpeed () |
Get the maximum speed of the offered engine. | |
Money | GetPrice () |
Get the new cost of the offered engine. | |
Money | GetRunningCost () |
Get the running cost of the offered engine. | |
int32 | GetVehicleType () |
bool | AcceptPreview () |
Accept the engine preview. | |
Static Public Member Functions | |
static const char * | GetClassName () |
static AIEventEnginePreview * | Convert (AIEvent *instance) |
Convert an AIEvent to the real instance. | |
Private Attributes | |
EngineID | engine |
You can get the same information about the offered engine as a real user would see in the offer window. And you can also accept the offer.
Definition at line 215 of file ai_event_types.hpp.
AIEventEnginePreview::AIEventEnginePreview | ( | EngineID | engine | ) | [inline] |
static AIEventEnginePreview* AIEventEnginePreview::Convert | ( | AIEvent * | instance | ) | [inline, static] |
Convert an AIEvent to the real instance.
instance | The instance to convert. |
Definition at line 232 of file ai_event_types.hpp.
char * AIEventEnginePreview::GetName | ( | ) |
Get the name of the offered engine.
Definition at line 21 of file ai_event_types.cpp.
References SetDParam().
CargoID AIEventEnginePreview::GetCargoType | ( | ) |
Get the cargo-type of the offered engine.
In case it can transport multiple cargos, it returns the first/main.
Definition at line 31 of file ai_event_types.cpp.
References CT_INVALID, and NUM_CARGO.
int32 AIEventEnginePreview::GetCapacity | ( | ) |
Get the capacity of the offered engine.
In case it can transport multiple cargos, it returns the first/main.
Definition at line 47 of file ai_event_types.cpp.
References NUM_CARGO, VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, and VEH_TRAIN.
int32 AIEventEnginePreview::GetMaxSpeed | ( | ) |
Get the maximum speed of the offered engine.
Definition at line 70 of file ai_event_types.cpp.
References _settings_game, VehicleSettings::plane_speed, VEH_AIRCRAFT, and GameSettings::vehicle.
Money AIEventEnginePreview::GetPrice | ( | ) |
Get the new cost of the offered engine.
Definition at line 78 of file ai_event_types.cpp.
Money AIEventEnginePreview::GetRunningCost | ( | ) |
Get the running cost of the offered engine.
Definition at line 83 of file ai_event_types.cpp.
bool AIEventEnginePreview::AcceptPreview | ( | ) |
Accept the engine preview.
Definition at line 99 of file ai_event_types.cpp.
References CMD_WANT_ENGINE_PREVIEW, and AIObject::DoCommand().