# engine_type.h

Go to the documentation of this file.

    00001 /* $Id: engine_type.h 15321 2009-02-02 21:52:34Z peter1138 $ */
    00002
    00005 #ifndef ENGINE_TYPE_H
    00006 #define ENGINE_TYPE_H
    00007
    00008 #include "rail_type.h"
    00009 #include "cargo_type.h"
    00010 #include "vehicle_type.h"
    00011 #include "gfx_type.h"
    00012 #include "date_type.h"
    00013 #include "sound_type.h"
    00014 #include "company_type.h"
    00015 #include "strings_type.h"
    00016
    00017 typedef uint16 EngineID;
    00018
    00019 struct Engine;
    00020
    00021 enum RailVehicleTypes {
    00022   RAILVEH_SINGLEHEAD,
    00023   RAILVEH_MULTIHEAD,
    00024   RAILVEH_WAGON,
    00025 };
    00026
    00027 enum EngineClass {
    00028   EC_STEAM,
    00029   EC_DIESEL,
    00030   EC_ELECTRIC,
    00031   EC_MONORAIL,
    00032   EC_MAGLEV,
    00033 };
    00034
    00035 struct RailVehicleInfo {
    00036   byte image_index;
    00037   RailVehicleTypes railveh_type;
    00038   byte cost_factor;
    00039   RailTypeByte railtype;
    00040   uint16 max_speed;
    00041   uint16 power;
    00042   uint16 weight;
    00043   byte running_cost;
    00044   byte running_cost_class;
    00045   EngineClass engclass;
    00046   byte capacity;
    00047   CargoID cargo_type;
    00048   byte ai_rank;
    00049   byte ai_passenger_only;
    00050   uint16 pow_wag_power;
    00051   byte pow_wag_weight;
    00052   byte visual_effect; // NOTE: this is not 100% implemented yet, at the moment it is only used as a 'fallback' value
    00053                       //       for when the 'powered wagon' callback fails. But it should really also determine what
    00054                       //       kind of visual effect to generate for a vehicle (default, steam, diesel, electric).
    00055                       //       Same goes for the callback result, which atm is only used to check if a wagon is powered.
    00056   byte shorten_factor;
    00057   byte tractive_effort;
    00058   byte user_def_data;
    00059 };
    00060
    00061 struct ShipVehicleInfo {
    00062   byte image_index;
    00063   byte cost_factor;
    00064   uint16 max_speed;
    00065   CargoID cargo_type;
    00066   uint16 capacity;
    00067   byte running_cost;
    00068   SoundFxByte sfx;
    00069   bool refittable;
    00070 };
    00071
    00072 /* AircraftVehicleInfo subtypes, bitmask type.
    00073  * If bit 0 is 0 then it is a helicopter, otherwise it is a plane
    00074  * in which case bit 1 tells us whether it's a big(fast) plane or not */
    00075 enum {
    00076   AIR_HELI = 0,
    00077   AIR_CTOL = 1,
    00078   AIR_FAST = 2
    00079 };
    00080
    00081 struct AircraftVehicleInfo {
    00082   byte image_index;
    00083   byte cost_factor;
    00084   byte running_cost;
    00085   byte subtype;
    00086   SoundFxByte sfx;
    00087   byte acceleration;
    00088   uint16 max_speed;
    00089   byte mail_capacity;
    00090   uint16 passenger_capacity;
    00091 };
    00092
    00093 struct RoadVehicleInfo {
    00094   byte image_index;
    00095   byte cost_factor;
    00096   byte running_cost;
    00097   byte running_cost_class;
    00098   SoundFxByte sfx;
    00099   uint16 max_speed;
    00100   byte capacity;
    00101   CargoID cargo_type;
    00102   uint8 weight;
    00103   uint8 power;
    00104   uint8 tractive_effort;
    00105   uint8 air_drag;
    00106 };
    00107
    00111 struct EngineInfo {
    00112   Date base_intro;
    00113   Year lifelength;
    00114   Year base_life;
    00115   byte decay_speed;
    00116   byte load_amount;
    00117   byte climates;
    00118   uint32 refit_mask;
    00119   byte refit_cost;
    00120   byte misc_flags;
    00121   byte callbackmask;
    00122   int8 retire_early;
    00123   StringID string_id;
    00124 };
    00125
    00129 enum {
    00130   EF_RAIL_TILTS = 0,
    00131   EF_ROAD_TRAM  = 0,
    00132   EF_USES_2CC   = 1,
    00133   EF_RAIL_IS_MU = 2,
    00134 };
    00135
    00139 enum {
    00140   ENGINE_AVAILABLE         = 1,
    00141   ENGINE_EXCLUSIVE_PREVIEW = 2,
    00142   ENGINE_OFFER_WINDOW_OPEN = 4,
    00143 };
    00144
    00145 enum {
    00146   NUM_VEHICLE_TYPES             =   6,
    00147   MAX_LENGTH_ENGINE_NAME_BYTES  =  31,
    00148   MAX_LENGTH_ENGINE_NAME_PIXELS = 160,
    00149 };
    00150
    00151 static const EngineID INVALID_ENGINE = 0xFFFF;
    00152
    00153 #endif /* ENGINE_TYPE_H */