src/engine_type.h
branchNewGRF_ports
changeset 10724 68a692eacf22
parent 10305 e90761e37744
child 10991 d8811e327d12
equal deleted inserted replaced
10349:ff900a23e102 10724:68a692eacf22
    12 #include "date_type.h"
    12 #include "date_type.h"
    13 #include "sound_type.h"
    13 #include "sound_type.h"
    14 #include "player_type.h"
    14 #include "player_type.h"
    15 #include "strings_type.h"
    15 #include "strings_type.h"
    16 
    16 
       
    17 #include <vector>
       
    18 
    17 typedef uint16 EngineID;
    19 typedef uint16 EngineID;
    18 typedef uint16 EngineRenewID;
    20 typedef uint16 EngineRenewID;
    19 typedef EngineID *EngineList; ///< engine list type placeholder acceptable for C code (see helpers.cpp)
    21 typedef std::vector<EngineID> EngineList; ///< engine list type
       
    22 
       
    23 struct Engine;
    20 
    24 
    21 enum RailVehicleTypes {
    25 enum RailVehicleTypes {
    22 	RAILVEH_SINGLEHEAD,  ///< indicates a "standalone" locomotive
    26 	RAILVEH_SINGLEHEAD,  ///< indicates a "standalone" locomotive
    23 	RAILVEH_MULTIHEAD,   ///< indicates a combination of two locomotives
    27 	RAILVEH_MULTIHEAD,   ///< indicates a combination of two locomotives
    24 	RAILVEH_WAGON,       ///< simple wagon, not motorized
    28 	RAILVEH_WAGON,       ///< simple wagon, not motorized
   128 	byte callbackmask;
   132 	byte callbackmask;
   129 	int8 retire_early;  ///< Number of years early to retire vehicle
   133 	int8 retire_early;  ///< Number of years early to retire vehicle
   130 	StringID string_id; ///< Default name of engine
   134 	StringID string_id; ///< Default name of engine
   131 };
   135 };
   132 
   136 
   133 struct Engine {
       
   134 	char *name;         ///< Custom name of engine
       
   135 	Date intro_date;
       
   136 	Date age;
       
   137 	uint16 reliability;
       
   138 	uint16 reliability_spd_dec;
       
   139 	uint16 reliability_start, reliability_max, reliability_final;
       
   140 	uint16 duration_phase_1, duration_phase_2, duration_phase_3;
       
   141 	byte lifelength;
       
   142 	byte flags;
       
   143 	uint8 preview_player_rank;
       
   144 	byte preview_wait;
       
   145 	byte player_avail;
       
   146 	VehicleType type; ///< type, ie VEH_ROAD, VEH_TRAIN, etc.
       
   147 };
       
   148 
       
   149 /**
   137 /**
   150  * EngineInfo.misc_flags is a bitmask, with the following values
   138  * EngineInfo.misc_flags is a bitmask, with the following values
   151  */
   139  */
   152 enum {
   140 enum {
   153 	EF_RAIL_TILTS = 0, ///< Rail vehicle tilts in curves
   141 	EF_RAIL_TILTS = 0, ///< Rail vehicle tilts in curves
   169 	NUM_VEHICLE_TYPES = 6
   157 	NUM_VEHICLE_TYPES = 6
   170 };
   158 };
   171 
   159 
   172 static const EngineID INVALID_ENGINE = 0xFFFF;
   160 static const EngineID INVALID_ENGINE = 0xFFFF;
   173 
   161 
   174 enum {
       
   175 	NUM_NORMAL_RAIL_ENGINES = 54,
       
   176 	NUM_MONORAIL_ENGINES    = 30,
       
   177 	NUM_MAGLEV_ENGINES      = 32,
       
   178 	NUM_TRAIN_ENGINES       = NUM_NORMAL_RAIL_ENGINES + NUM_MONORAIL_ENGINES + NUM_MAGLEV_ENGINES,
       
   179 	NUM_ROAD_ENGINES        = 88,
       
   180 	NUM_SHIP_ENGINES        = 11,
       
   181 	NUM_AIRCRAFT_ENGINES    = 41,
       
   182 	TOTAL_NUM_ENGINES       = NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES + NUM_SHIP_ENGINES + NUM_AIRCRAFT_ENGINES,
       
   183 	AIRCRAFT_ENGINES_INDEX  = NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES + NUM_SHIP_ENGINES,
       
   184 	SHIP_ENGINES_INDEX      = NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES,
       
   185 	ROAD_ENGINES_INDEX      = NUM_TRAIN_ENGINES,
       
   186 };
       
   187 
       
   188 #endif /* ENGINE_TYPE_H */
   162 #endif /* ENGINE_TYPE_H */