tron@2186: /* $Id$ */ tron@2186: rubidium@8777: /** @file engine_type.h Types related to engines. */ belugas@6125: rubidium@8777: #ifndef ENGINE_TYPE_H rubidium@8777: #define ENGINE_TYPE_H truelight@0: rubidium@8103: #include "rail_type.h" rubidium@8119: #include "cargo_type.h" rubidium@8119: #include "vehicle_type.h" rubidium@8123: #include "gfx_type.h" rubidium@8140: #include "date_type.h" rubidium@8157: #include "sound_type.h" rubidium@8254: #include "player_type.h" rubidium@8264: #include "strings_type.h" darkvater@405: smatz@9135: #include smatz@9135: rubidium@8777: typedef uint16 EngineID; rubidium@8777: typedef uint16 EngineRenewID; smatz@9135: typedef std::vector EngineList; ///< engine list type rubidium@8777: peter1138@9070: struct Engine; peter1138@9070: belugas@5868: enum RailVehicleTypes { belugas@6125: RAILVEH_SINGLEHEAD, ///< indicates a "standalone" locomotive belugas@6125: RAILVEH_MULTIHEAD, ///< indicates a combination of two locomotives belugas@6125: RAILVEH_WAGON, ///< simple wagon, not motorized belugas@5868: }; belugas@5868: rubidium@6581: enum EngineClass { rubidium@6581: EC_STEAM, rubidium@6581: EC_DIESEL, rubidium@6581: EC_ELECTRIC, rubidium@6585: EC_MONORAIL, rubidium@6585: EC_MAGLEV, rubidium@6581: }; rubidium@6581: rubidium@6248: struct RailVehicleInfo { truelight@0: byte image_index; belugas@5868: RailVehicleTypes railveh_type; truelight@0: byte base_cost; tron@5823: RailTypeByte railtype; truelight@0: uint16 max_speed; truelight@0: uint16 power; peter1138@2542: uint16 weight; peter1138@8622: byte running_cost; peter1138@2840: byte running_cost_class; rubidium@6581: EngineClass engclass; ///< Class of engine for this vehicle truelight@0: byte capacity; Darkvater@3344: CargoID cargo_type; peter1138@3022: byte ai_rank; peter1138@8449: byte ai_passenger_only; ///< Bit value to tell AI that this engine is for passenger use only hackykid@1908: uint16 pow_wag_power; hackykid@1908: byte pow_wag_weight; hackykid@1908: byte visual_effect; // NOTE: this is not 100% implemented yet, at the moment it is only used as a 'fallback' value hackykid@1908: // for when the 'powered wagon' callback fails. But it should really also determine what hackykid@1908: // kind of visual effect to generate for a vehicle (default, steam, diesel, electric). hackykid@1908: // Same goes for the callback result, which atm is only used to check if a wagon is powered. belugas@6125: byte shorten_factor; ///< length on main map for this type is 8 - shorten_factor rubidium@7318: byte tractive_effort; ///< Tractive effort coefficient belugas@6125: byte user_def_data; ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles rubidium@6248: }; truelight@0: rubidium@6248: struct ShipVehicleInfo { truelight@0: byte image_index; truelight@0: byte base_cost; truelight@0: uint16 max_speed; Darkvater@3344: CargoID cargo_type; truelight@0: uint16 capacity; truelight@0: byte running_cost; rubidium@5587: SoundFxByte sfx; rubidium@5587: bool refittable; rubidium@6248: }; truelight@0: Darkvater@5855: /* AircraftVehicleInfo subtypes, bitmask type. Darkvater@5855: * If bit 0 is 0 then it is a helicopter, otherwise it is a plane Darkvater@5855: * in which case bit 1 tells us whether it's a big(fast) plane or not */ tron@4023: enum { Darkvater@5855: AIR_HELI = 0, belugas@6125: AIR_CTOL = 1, ///< Conventional Take Off and Landing, i.e. planes tron@4023: AIR_FAST = 2 tron@4023: }; tron@4023: rubidium@6248: struct AircraftVehicleInfo { darkvater@376: byte image_index; darkvater@376: byte base_cost; darkvater@376: byte running_cost; darkvater@376: byte subtype; rubidium@5587: SoundFxByte sfx; darkvater@376: byte acceleration; celestar@6193: uint16 max_speed; darkvater@376: byte mail_capacity; celestar@922: uint16 passenger_capacity; rubidium@6248: }; darkvater@376: rubidium@6248: struct RoadVehicleInfo { darkvater@376: byte image_index; darkvater@376: byte base_cost; darkvater@376: byte running_cost; peter1138@8626: byte running_cost_class; rubidium@5587: SoundFxByte sfx; darkvater@376: byte max_speed; darkvater@376: byte capacity; Darkvater@3344: CargoID cargo_type; rubidium@6248: }; truelight@0: celestar@2129: /** Information about a vehicle rubidium@4549: * @see table/engines.h rubidium@4549: */ rubidium@6248: struct EngineInfo { rubidium@4289: Date base_intro; rubidium@4326: Year lifelength; rubidium@4326: Year base_life; belugas@6488: byte unk2; ///< flag for carriage(bit 7) and decay speed(bits0..6) peter1138@5211: byte load_amount; tron@5763: byte climates; peter1138@2611: uint32 refit_mask; peter1138@3997: byte refit_cost; peter1138@3095: byte misc_flags; peter1138@3956: byte callbackmask; frosch@8509: int8 retire_early; ///< Number of years early to retire vehicle peter1138@8258: StringID string_id; ///< Default name of engine rubidium@6248: }; truelight@0: peter1138@3113: /** peter1138@3113: * EngineInfo.misc_flags is a bitmask, with the following values peter1138@3113: */ peter1138@3113: enum { rubidium@6685: EF_RAIL_TILTS = 0, ///< Rail vehicle tilts in curves rubidium@6685: EF_ROAD_TRAM = 0, ///< Road vehicle is a tram/light rail vehicle peter1138@3113: EF_USES_2CC = 1, ///< Vehicle uses two company colours peter1138@3113: EF_RAIL_IS_MU = 2, ///< Rail vehicle is a multiple-unit (DMU/EMU) peter1138@3113: }; truelight@0: maedhros@6174: /** maedhros@6174: * Engine.flags is a bitmask, with the following values. maedhros@6174: */ maedhros@6174: enum { maedhros@6174: ENGINE_AVAILABLE = 1, ///< This vehicle is available to everyone. maedhros@6174: ENGINE_EXCLUSIVE_PREVIEW = 2, ///< This vehicle is in the exclusive preview stage, either being used or being offered to a player. maedhros@6174: ENGINE_OFFER_WINDOW_OPEN = 4, ///< The exclusive offer window is currently open for a player. maedhros@6174: }; maedhros@6174: truelight@0: enum { Darkvater@1802: NUM_VEHICLE_TYPES = 6 Darkvater@1802: }; truelight@0: rubidium@5587: static const EngineID INVALID_ENGINE = 0xFFFF; rubidium@5587: rubidium@8777: #endif /* ENGINE_TYPE_H */