# engine_type.h

Go to the documentation of this file.

    00001 /* $Id: engine_type.h 18809 2010-01-15 16:41:15Z rubidium $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    00008  */
    00009
    00012 #ifndef ENGINE_TYPE_H
    00013 #define ENGINE_TYPE_H
    00014
    00015 #include "economy_type.h"
    00016 #include "rail_type.h"
    00017 #include "cargo_type.h"
    00018 #include "date_type.h"
    00019 #include "sound_type.h"
    00020 #include "strings_type.h"
    00021
    00022 typedef uint16 EngineID;
    00023
    00024 struct Engine;
    00025
    00026 enum RailVehicleTypes {
    00027   RAILVEH_SINGLEHEAD,
    00028   RAILVEH_MULTIHEAD,
    00029   RAILVEH_WAGON,
    00030 };
    00031
    00032 enum EngineClass {
    00033   EC_STEAM,
    00034   EC_DIESEL,
    00035   EC_ELECTRIC,
    00036   EC_MONORAIL,
    00037   EC_MAGLEV,
    00038 };
    00039
    00040 struct RailVehicleInfo {
    00041   byte image_index;
    00042   RailVehicleTypes railveh_type;
    00043   byte cost_factor;
    00044   RailTypeByte railtype;
    00045   uint16 max_speed;
    00046   uint16 power;
    00047   uint16 weight;
    00048   byte running_cost;
    00049   Price running_cost_class;
    00050   EngineClass engclass;
    00051   byte capacity;
    00052   byte ai_passenger_only;
    00053   uint16 pow_wag_power;
    00054   byte pow_wag_weight;
    00055   byte visual_effect;
    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   uint16 capacity;
    00066   byte running_cost;
    00067   SoundID sfx;
    00068   bool old_refittable;
    00069 };
    00070
    00071 /* AircraftVehicleInfo subtypes, bitmask type.
    00072  * If bit 0 is 0 then it is a helicopter, otherwise it is a plane
    00073  * in which case bit 1 tells us whether it's a big(fast) plane or not */
    00074 enum {
    00075   AIR_HELI = 0,
    00076   AIR_CTOL = 1,
    00077   AIR_FAST = 2
    00078 };
    00079
    00080 struct AircraftVehicleInfo {
    00081   byte image_index;
    00082   byte cost_factor;
    00083   byte running_cost;
    00084   byte subtype;
    00085   SoundID sfx;
    00086   byte acceleration;
    00087   uint16 max_speed;
    00088   byte mail_capacity;
    00089   uint16 passenger_capacity;
    00090 };
    00091
    00092 struct RoadVehicleInfo {
    00093   byte image_index;
    00094   byte cost_factor;
    00095   byte running_cost;
    00096   Price running_cost_class;
    00097   SoundID sfx;
    00098   uint16 max_speed;
    00099   byte capacity;
    00100   uint8 weight;
    00101   uint8 power;
    00102   uint8 tractive_effort;
    00103   uint8 air_drag;
    00104 };
    00105
    00109 struct EngineInfo {
    00110   Date base_intro;
    00111   Year lifelength;
    00112   Year base_life;
    00113   byte decay_speed;
    00114   byte load_amount;
    00115   byte climates;
    00116   CargoID cargo_type;
    00117   uint32 refit_mask;
    00118   byte refit_cost;
    00119   byte misc_flags;
    00120   byte callback_mask;
    00121   int8 retire_early;
    00122   StringID string_id;
    00123 };
    00124
    00128 enum {
    00129   EF_RAIL_TILTS = 0,
    00130   EF_ROAD_TRAM  = 0,
    00131   EF_USES_2CC   = 1,
    00132   EF_RAIL_IS_MU = 2,
    00133 };
    00134
    00138 enum {
    00139   ENGINE_AVAILABLE         = 1,
    00140   ENGINE_EXCLUSIVE_PREVIEW = 2,
    00141   ENGINE_OFFER_WINDOW_OPEN = 4,
    00142 };
    00143
    00144 enum {
    00145   NUM_VEHICLE_TYPES             =   6,
    00146   MAX_LENGTH_ENGINE_NAME_BYTES  =  31,
    00147   MAX_LENGTH_ENGINE_NAME_PIXELS = 160,
    00148 };
    00149
    00150 static const EngineID INVALID_ENGINE = 0xFFFF;
    00151
    00152 #endif /* ENGINE_TYPE_H */