#include "rail_type.h"#include "cargo_type.h"#include "vehicle_type.h"#include "gfx_type.h"#include "date_type.h"#include "sound_type.h"#include "player_type.h"#include "strings_type.h"Go to the source code of this file.
Data Structures | |
| struct | RailVehicleInfo |
| struct | ShipVehicleInfo |
| struct | AircraftVehicleInfo |
| struct | RoadVehicleInfo |
| struct | EngineInfo |
| Information about a vehicle. More... | |
| struct | Engine |
Defines | |
| #define | FOR_ALL_ENGINES(e) for (e = _engines; e != endof(_engines); e++) |
| #define | FOR_ALL_ENGINEIDS_OF_TYPE(e, type) for (e = GetFirstEngineOfType(type); e != GetLastEngineOfType(type); e++) |
Typedefs | |
| typedef int CDECL | EngList_SortTypeFunction (const void *, const void *) |
| argument type for EngList_Sort() | |
Enumerations | |
| enum | RailVehicleTypes { RAILVEH_SINGLEHEAD, RAILVEH_MULTIHEAD, RAILVEH_WAGON } |
| enum | EngineClass { EC_STEAM, EC_DIESEL, EC_ELECTRIC, EC_MONORAIL, EC_MAGLEV } |
| enum | { AIR_HELI = 0, AIR_CTOL = 1, AIR_FAST = 2 } |
| enum | { EF_RAIL_TILTS = 0, EF_ROAD_TRAM = 0, EF_USES_2CC = 1, EF_RAIL_IS_MU = 2 } |
| EngineInfo.misc_flags is a bitmask, with the following values. More... | |
| enum | { ENGINE_AVAILABLE = 1, ENGINE_EXCLUSIVE_PREVIEW = 2, ENGINE_OFFER_WINDOW_OPEN = 4 } |
| Engine.flags is a bitmask, with the following values. More... | |
| enum | { NUM_VEHICLE_TYPES = 6 } |
| enum | { NUM_NORMAL_RAIL_ENGINES = 54, NUM_MONORAIL_ENGINES = 30, NUM_MAGLEV_ENGINES = 32, NUM_TRAIN_ENGINES = NUM_NORMAL_RAIL_ENGINES + NUM_MONORAIL_ENGINES + NUM_MAGLEV_ENGINES, NUM_ROAD_ENGINES = 88, NUM_SHIP_ENGINES = 11, NUM_AIRCRAFT_ENGINES = 41, TOTAL_NUM_ENGINES = NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES + NUM_SHIP_ENGINES + NUM_AIRCRAFT_ENGINES, AIRCRAFT_ENGINES_INDEX = NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES + NUM_SHIP_ENGINES, SHIP_ENGINES_INDEX = NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES, ROAD_ENGINES_INDEX = NUM_TRAIN_ENGINES } |
Functions | |
| void | SetupEngines () |
| void | StartupEngines () |
| void | DrawTrainEngine (int x, int y, EngineID engine, SpriteID pal) |
| void | DrawRoadVehEngine (int x, int y, EngineID engine, SpriteID pal) |
| void | DrawShipEngine (int x, int y, EngineID engine, SpriteID pal) |
| void | DrawAircraftEngine (int x, int y, EngineID engine, SpriteID pal) |
| void | LoadCustomEngineNames () |
| void | DeleteCustomEngineNames () |
| bool | IsEngineBuildable (EngineID engine, VehicleType type, PlayerID player) |
| Check if an engine is buildable. | |
| CargoID | GetEngineCargoType (EngineID engine) |
| Get the default cargo type for a certain engine type. | |
| static EngineID | GetFirstEngineOfType (VehicleType type) |
| static EngineID | GetLastEngineOfType (VehicleType type) |
| static Engine * | GetEngine (EngineID i) |
| static bool | IsEngineIndex (uint index) |
| static const EngineInfo * | EngInfo (EngineID e) |
| static const RailVehicleInfo * | RailVehInfo (EngineID e) |
| static const ShipVehicleInfo * | ShipVehInfo (EngineID e) |
| static const AircraftVehicleInfo * | AircraftVehInfo (EngineID e) |
| static const RoadVehicleInfo * | RoadVehInfo (EngineID e) |
| void | EngList_Create (EngineList *el) |
| Creates engine list. | |
| void | EngList_Destroy (EngineList *el) |
| Deallocate and destroy engine list. | |
| uint | EngList_Count (const EngineList *el) |
| Returns number of items in the engine list. | |
| void | EngList_Add (EngineList *el, EngineID eid) |
| Append one item at the end of engine list. | |
| EngineID * | EngList_Items (EngineList *el) |
| Returns engine list items as C array. | |
| void | EngList_RemoveAll (EngineList *el) |
| Removes all items from engine list. | |
| void | EngList_Sort (EngineList *el, EngList_SortTypeFunction compare) |
| qsort of the engine list | |
| void | EngList_SortPartial (EngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items) |
| qsort of specified portion of the engine list | |
Variables | |
| static const EngineID | INVALID_ENGINE = 0xFFFF |
| Engine | _engines [TOTAL_NUM_ENGINES] |
| const EngineInfo | _orig_engine_info [TOTAL_NUM_ENGINES] |
| const RailVehicleInfo | _orig_rail_vehicle_info [NUM_TRAIN_ENGINES] |
| const ShipVehicleInfo | _orig_ship_vehicle_info [NUM_SHIP_ENGINES] |
| const AircraftVehicleInfo | _orig_aircraft_vehicle_info [NUM_AIRCRAFT_ENGINES] |
| const RoadVehicleInfo | _orig_road_vehicle_info [NUM_ROAD_ENGINES] |
| EngineInfo | _engine_info [TOTAL_NUM_ENGINES] |
| RailVehicleInfo | _rail_vehicle_info [NUM_TRAIN_ENGINES] |
| ShipVehicleInfo | _ship_vehicle_info [NUM_SHIP_ENGINES] |
| AircraftVehicleInfo | _aircraft_vehicle_info [NUM_AIRCRAFT_ENGINES] |
| RoadVehicleInfo | _road_vehicle_info [NUM_ROAD_ENGINES] |
Definition in file engine.h.
| anonymous enum |
| anonymous enum |
| anonymous enum |
Engine.flags is a bitmask, with the following values.
| enum RailVehicleTypes |
| void EngList_Add | ( | EngineList * | el, | |
| EngineID | eid | |||
| ) |
Append one item at the end of engine list.
Append one item at the end of engine list.
| el | list o which to add an engine | |
| eid | engine to add to the list |
Definition at line 49 of file helpers.cpp.
Referenced by GenerateReplaceVehList().
| uint EngList_Count | ( | const EngineList * | el | ) |
Returns number of items in the engine list.
Returns number of items in the engine list.
| el | list for count inquiry |
Definition at line 40 of file helpers.cpp.
Referenced by DrawEngineList(), and GenerateLists().
| void EngList_Create | ( | EngineList * | el | ) |
Creates engine list.
Creates engine list.
| el | list to be created |
Definition at line 21 of file helpers.cpp.
| void EngList_Destroy | ( | EngineList * | el | ) |
Deallocate and destroy engine list.
Deallocate and destroy engine list.
| el | list to be destroyed |
Definition at line 30 of file helpers.cpp.
| EngineID* EngList_Items | ( | EngineList * | el | ) |
Returns engine list items as C array.
Returns engine list items as C array.
| el | list from which the array pointer has to be returned |
Definition at line 58 of file helpers.cpp.
| void EngList_RemoveAll | ( | EngineList * | el | ) |
Removes all items from engine list.
Removes all items from engine list.
| el | list to be cleared |
Definition at line 66 of file helpers.cpp.
Referenced by GenerateLists(), and GenerateReplaceVehList().
| void EngList_Sort | ( | EngineList * | el, | |
| EngList_SortTypeFunction | compare | |||
| ) |
qsort of the engine list
qsort of the engine list
| el | list to be sorted | |
| compare | function for evaluation of the quicksort |
Definition at line 75 of file helpers.cpp.
Referenced by GenerateReplaceVehList().
| void EngList_SortPartial | ( | EngineList * | el, | |
| EngList_SortTypeFunction | compare, | |||
| uint | begin, | |||
| uint | num_items | |||
| ) |
qsort of specified portion of the engine list
qsort of specified portion of the engine list
| el | list to be sorted | |
| compare | function for evaluation of the quicksort | |
| begin | start of sorting | |
| num_items | count of items to be sorted |
Definition at line 86 of file helpers.cpp.
| CargoID GetEngineCargoType | ( | EngineID | engine | ) |
Get the default cargo type for a certain engine type.
| engine | The ID to get the cargo for |
Definition at line 446 of file engine.cpp.
Referenced by CmdCloneVehicle().
| bool IsEngineBuildable | ( | EngineID | engine, | |
| VehicleType | type, | |||
| PlayerID | player | |||
| ) |
Check if an engine is buildable.
| engine | index of the engine to check. | |
| type | the type the engine should be. | |
| player | index of the player. |
Definition at line 420 of file engine.cpp.
References HasBit().
Referenced by CmdBuildAircraft(), CmdBuildRailVehicle(), CmdBuildRoadVeh(), CmdBuildShip(), and GenerateReplaceVehList().
1.5.6