src/engine_type.h
author rubidium
Thu, 18 Dec 2008 12:23:08 +0000
changeset 10436 8d3a9fbe8f19
parent 10208 72c00af5c95d
permissions -rw-r--r--
(svn r14689) -Change: make configure die on commonly made user mistakes, like not having SDL development files or zlib headers installed; you can still compile a dedicated server or a binary without zlib, but you have to explicitly force it.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2129
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2129
diff changeset
     2
8777
5ba12006e339 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium
parents: 8774
diff changeset
     3
/** @file engine_type.h Types related to engines. */
6125
a6fff965707c (svn r8862) -Cleanup: doxygen changes, again. Mostly @files missing tags and a few comments style.
belugas
parents: 5955
diff changeset
     4
8777
5ba12006e339 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium
parents: 8774
diff changeset
     5
#ifndef ENGINE_TYPE_H
5ba12006e339 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium
parents: 8774
diff changeset
     6
#define ENGINE_TYPE_H
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
8103
cf92483a0abf (svn r11664) -Codechange: use more specific ("rail_type.h" instead of "rail.h" that includes way more than only "rail_type.h") includes at some places.
rubidium
parents: 7496
diff changeset
     8
#include "rail_type.h"
8119
52b48108425a (svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium
parents: 8103
diff changeset
     9
#include "cargo_type.h"
52b48108425a (svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium
parents: 8103
diff changeset
    10
#include "vehicle_type.h"
8123
ce31d2843a95 (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8119
diff changeset
    11
#include "gfx_type.h"
8140
0d0d8c94f84b (svn r11702) -Codechange: move all date related stuff to date*.
rubidium
parents: 8139
diff changeset
    12
#include "date_type.h"
8157
1505def01945 (svn r11719) -Codechange: split sound.h in a header with types and one with functions.
rubidium
parents: 8140
diff changeset
    13
#include "sound_type.h"
10208
72c00af5c95d (svn r14422) -Codechange: also reflect the changes of r14421 in the filenames.
rubidium
parents: 10207
diff changeset
    14
#include "company_type.h"
8264
b1e85998c7d3 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8259
diff changeset
    15
#include "strings_type.h"
405
415546028e8d (svn r602) -newgrf: Move DrawTileSeqStruct & co and struct SpriteGroup to sprite.h (pasky)
darkvater
parents: 389
diff changeset
    16
8777
5ba12006e339 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium
parents: 8774
diff changeset
    17
typedef uint16 EngineID;
5ba12006e339 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium
parents: 8774
diff changeset
    18
9070
dd0121143eba (svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist.
peter1138
parents: 8777
diff changeset
    19
struct Engine;
dd0121143eba (svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist.
peter1138
parents: 8777
diff changeset
    20
5868
94430141c189 (svn r8455) -Codechange: Give a more meaningful name (railveh_type)to member flags of RailVehInfo, as well as changing the code to reflect the fact that it was not a flag but rather a one value only variable. Doing so, some evaluations have been simplified.
belugas
parents: 5855
diff changeset
    21
enum RailVehicleTypes {
6125
a6fff965707c (svn r8862) -Cleanup: doxygen changes, again. Mostly @files missing tags and a few comments style.
belugas
parents: 5955
diff changeset
    22
	RAILVEH_SINGLEHEAD,  ///< indicates a "standalone" locomotive
a6fff965707c (svn r8862) -Cleanup: doxygen changes, again. Mostly @files missing tags and a few comments style.
belugas
parents: 5955
diff changeset
    23
	RAILVEH_MULTIHEAD,   ///< indicates a combination of two locomotives
a6fff965707c (svn r8862) -Cleanup: doxygen changes, again. Mostly @files missing tags and a few comments style.
belugas
parents: 5955
diff changeset
    24
	RAILVEH_WAGON,       ///< simple wagon, not motorized
5868
94430141c189 (svn r8455) -Codechange: Give a more meaningful name (railveh_type)to member flags of RailVehInfo, as well as changing the code to reflect the fact that it was not a flag but rather a one value only variable. Doing so, some evaluations have been simplified.
belugas
parents: 5855
diff changeset
    25
};
94430141c189 (svn r8455) -Codechange: Give a more meaningful name (railveh_type)to member flags of RailVehInfo, as well as changing the code to reflect the fact that it was not a flag but rather a one value only variable. Doing so, some evaluations have been simplified.
belugas
parents: 5855
diff changeset
    26
6581
3641873f4f3f (svn r9795) -Codechange: enumify the EngineClass.
rubidium
parents: 6505
diff changeset
    27
enum EngineClass {
3641873f4f3f (svn r9795) -Codechange: enumify the EngineClass.
rubidium
parents: 6505
diff changeset
    28
	EC_STEAM,
3641873f4f3f (svn r9795) -Codechange: enumify the EngineClass.
rubidium
parents: 6505
diff changeset
    29
	EC_DIESEL,
3641873f4f3f (svn r9795) -Codechange: enumify the EngineClass.
rubidium
parents: 6505
diff changeset
    30
	EC_ELECTRIC,
6585
46035c6baa8d (svn r9799) -Codechange: separate engine class and engine running cost class (mart3p).
rubidium
parents: 6581
diff changeset
    31
	EC_MONORAIL,
46035c6baa8d (svn r9799) -Codechange: separate engine class and engine running cost class (mart3p).
rubidium
parents: 6581
diff changeset
    32
	EC_MAGLEV,
6581
3641873f4f3f (svn r9795) -Codechange: enumify the EngineClass.
rubidium
parents: 6505
diff changeset
    33
};
3641873f4f3f (svn r9795) -Codechange: enumify the EngineClass.
rubidium
parents: 6505
diff changeset
    34
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    35
struct RailVehicleInfo {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    36
	byte image_index;
5868
94430141c189 (svn r8455) -Codechange: Give a more meaningful name (railveh_type)to member flags of RailVehInfo, as well as changing the code to reflect the fact that it was not a flag but rather a one value only variable. Doing so, some evaluations have been simplified.
belugas
parents: 5855
diff changeset
    37
	RailVehicleTypes railveh_type;
9923
3056bf623139 (svn r14078) -Codechange: Rename *VehicleInfo::base_cost to cost_factor, indicating what it actually is.
peter1138
parents: 9913
diff changeset
    38
	byte cost_factor;               ///< Purchase cost factor;      For multiheaded engines the sum of both engine prices.
5823
7aa8c2312103 (svn r8385) -Fix
tron
parents: 5770
diff changeset
    39
	RailTypeByte railtype;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    40
	uint16 max_speed;
9720
2a0354eea879 (svn r13844) -Fix (r13074, r13591): Power, running cost and capacity of multiheaded engines were (too often) doubled in newspaper resp. offer window.
frosch
parents: 9468
diff changeset
    41
	uint16 power;                   ///< Power of engine;           For multiheaded engines the sum of both engine powers.
2a0354eea879 (svn r13844) -Fix (r13074, r13591): Power, running cost and capacity of multiheaded engines were (too often) doubled in newspaper resp. offer window.
frosch
parents: 9468
diff changeset
    42
	uint16 weight;                  ///< Weight of vehicle;         For multiheaded engines the weight of each single engine.
2a0354eea879 (svn r13844) -Fix (r13074, r13591): Power, running cost and capacity of multiheaded engines were (too often) doubled in newspaper resp. offer window.
frosch
parents: 9468
diff changeset
    43
	byte running_cost;              ///< Running cost of engine;    For multiheaded engines the sum of both running costs.
2840
9038b4ab8c9a (svn r3388) - NewGRF: Allow train running cost class to differ from engine class. Also fix typo in r3384.
peter1138
parents: 2817
diff changeset
    44
	byte running_cost_class;
6581
3641873f4f3f (svn r9795) -Codechange: enumify the EngineClass.
rubidium
parents: 6505
diff changeset
    45
	EngineClass engclass;           ///< Class of engine for this vehicle
9720
2a0354eea879 (svn r13844) -Fix (r13074, r13591): Power, running cost and capacity of multiheaded engines were (too often) doubled in newspaper resp. offer window.
frosch
parents: 9468
diff changeset
    46
	byte capacity;                  ///< Cargo capacity of vehicle; For multiheaded engines the capacity of each single engine.
3344
fc86351d4641 (svn r4128) - CodeChange: Add proper semantics for CargoID for such variables instead of using the general byte-type.
Darkvater
parents: 3113
diff changeset
    47
	CargoID cargo_type;
3022
d4b90d0b5b24 (svn r3602) - Move _railveh_score data to _rail_vehicle_info->ai_rank and remove global variable to return data as we can now access this directly.
peter1138
parents: 3006
diff changeset
    48
	byte ai_rank;
8449
64c872ab3ed3 (svn r12019) -Codechange: Add support for passenger engine designation for AI-use, NewGRF property 0x08 for trains.
peter1138
parents: 8268
diff changeset
    49
	byte ai_passenger_only; ///< Bit value to tell AI that this engine is for passenger use only
1908
2fa391fed79a (svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it.
hackykid
parents: 1895
diff changeset
    50
	uint16 pow_wag_power;
2fa391fed79a (svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it.
hackykid
parents: 1895
diff changeset
    51
	byte pow_wag_weight;
2fa391fed79a (svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it.
hackykid
parents: 1895
diff changeset
    52
	byte visual_effect; // NOTE: this is not 100% implemented yet, at the moment it is only used as a 'fallback' value
2fa391fed79a (svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it.
hackykid
parents: 1895
diff changeset
    53
	                    //       for when the 'powered wagon' callback fails. But it should really also determine what
2fa391fed79a (svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it.
hackykid
parents: 1895
diff changeset
    54
	                    //       kind of visual effect to generate for a vehicle (default, steam, diesel, electric).
2fa391fed79a (svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it.
hackykid
parents: 1895
diff changeset
    55
	                    //       Same goes for the callback result, which atm is only used to check if a wagon is powered.
6125
a6fff965707c (svn r8862) -Cleanup: doxygen changes, again. Mostly @files missing tags and a few comments style.
belugas
parents: 5955
diff changeset
    56
	byte shorten_factor;   ///< length on main map for this type is 8 - shorten_factor
7318
632cd0497770 (svn r10673) -Cleanup: some assorted style cleanups. Primarily type* var -> type *var.
rubidium
parents: 6943
diff changeset
    57
	byte tractive_effort;  ///< Tractive effort coefficient
6125
a6fff965707c (svn r8862) -Cleanup: doxygen changes, again. Mostly @files missing tags and a few comments style.
belugas
parents: 5955
diff changeset
    58
	byte user_def_data;    ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    59
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    60
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    61
struct ShipVehicleInfo {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    62
	byte image_index;
9923
3056bf623139 (svn r14078) -Codechange: Rename *VehicleInfo::base_cost to cost_factor, indicating what it actually is.
peter1138
parents: 9913
diff changeset
    63
	byte cost_factor;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    64
	uint16 max_speed;
3344
fc86351d4641 (svn r4128) - CodeChange: Add proper semantics for CargoID for such variables instead of using the general byte-type.
Darkvater
parents: 3113
diff changeset
    65
	CargoID cargo_type;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    66
	uint16 capacity;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    67
	byte running_cost;
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    68
	SoundFxByte sfx;
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    69
	bool refittable;
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    70
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    71
5855
6f273e99a57a (svn r8429) -Codechange: Add a name for AircraftVehicleInfo subtype helicopter and remove some magic numbers related to the subtype.
Darkvater
parents: 5854
diff changeset
    72
/* AircraftVehicleInfo subtypes, bitmask type.
6f273e99a57a (svn r8429) -Codechange: Add a name for AircraftVehicleInfo subtype helicopter and remove some magic numbers related to the subtype.
Darkvater
parents: 5854
diff changeset
    73
 * If bit 0 is 0 then it is a helicopter, otherwise it is a plane
6f273e99a57a (svn r8429) -Codechange: Add a name for AircraftVehicleInfo subtype helicopter and remove some magic numbers related to the subtype.
Darkvater
parents: 5854
diff changeset
    74
 * in which case bit 1 tells us whether it's a big(fast) plane or not */
4023
5d84c056a2b1 (svn r5262) Add symbolic names for the aircraft subtypes. not perfect, but better than raw numbers
tron
parents: 3997
diff changeset
    75
enum {
5855
6f273e99a57a (svn r8429) -Codechange: Add a name for AircraftVehicleInfo subtype helicopter and remove some magic numbers related to the subtype.
Darkvater
parents: 5854
diff changeset
    76
	AIR_HELI = 0,
6125
a6fff965707c (svn r8862) -Cleanup: doxygen changes, again. Mostly @files missing tags and a few comments style.
belugas
parents: 5955
diff changeset
    77
	AIR_CTOL = 1, ///< Conventional Take Off and Landing, i.e. planes
4023
5d84c056a2b1 (svn r5262) Add symbolic names for the aircraft subtypes. not perfect, but better than raw numbers
tron
parents: 3997
diff changeset
    78
	AIR_FAST = 2
5d84c056a2b1 (svn r5262) Add symbolic names for the aircraft subtypes. not perfect, but better than raw numbers
tron
parents: 3997
diff changeset
    79
};
5d84c056a2b1 (svn r5262) Add symbolic names for the aircraft subtypes. not perfect, but better than raw numbers
tron
parents: 3997
diff changeset
    80
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    81
struct AircraftVehicleInfo {
376
6ffd7911bf39 (svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
darkvater
parents: 374
diff changeset
    82
	byte image_index;
9923
3056bf623139 (svn r14078) -Codechange: Rename *VehicleInfo::base_cost to cost_factor, indicating what it actually is.
peter1138
parents: 9913
diff changeset
    83
	byte cost_factor;
376
6ffd7911bf39 (svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
darkvater
parents: 374
diff changeset
    84
	byte running_cost;
6ffd7911bf39 (svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
darkvater
parents: 374
diff changeset
    85
	byte subtype;
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    86
	SoundFxByte sfx;
376
6ffd7911bf39 (svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
darkvater
parents: 374
diff changeset
    87
	byte acceleration;
6193
6f20de9e4f1b (svn r8973) -Feature/Codechange: Changed the internal unit for aircraft velocities to from 8mph to 1km/h (peter1138), also give aircraft realsitic velocities (so that 1km/h is 1km/h independent of vehicle type) (peter1138). Introduce a flag to reduce aircraft speed in holding patterns to some realistic velocity. Use this flag for the city airport for the time being and make use of the different entry points for this airport type.
celestar
parents: 6174
diff changeset
    88
	uint16 max_speed;
376
6ffd7911bf39 (svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
darkvater
parents: 374
diff changeset
    89
	byte mail_capacity;
922
10035216cbaf (svn r1410) Replaced all occurences of 'passanger' by 'passenger' in the code
celestar
parents: 842
diff changeset
    90
	uint16 passenger_capacity;
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    91
};
376
6ffd7911bf39 (svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
darkvater
parents: 374
diff changeset
    92
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    93
struct RoadVehicleInfo {
376
6ffd7911bf39 (svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
darkvater
parents: 374
diff changeset
    94
	byte image_index;
9923
3056bf623139 (svn r14078) -Codechange: Rename *VehicleInfo::base_cost to cost_factor, indicating what it actually is.
peter1138
parents: 9913
diff changeset
    95
	byte cost_factor;
376
6ffd7911bf39 (svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
darkvater
parents: 374
diff changeset
    96
	byte running_cost;
8626
9781464622be (svn r12209) -Fix: [NewGRF] Support using any base price for rail and road vehicles' running cost, and show running cost of wagons if they have it.
peter1138
parents: 8622
diff changeset
    97
	byte running_cost_class;
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    98
	SoundFxByte sfx;
376
6ffd7911bf39 (svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
darkvater
parents: 374
diff changeset
    99
	byte max_speed;
6ffd7911bf39 (svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
darkvater
parents: 374
diff changeset
   100
	byte capacity;
3344
fc86351d4641 (svn r4128) - CodeChange: Add proper semantics for CargoID for such variables instead of using the general byte-type.
Darkvater
parents: 3113
diff changeset
   101
	CargoID cargo_type;
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   102
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   103
2129
5a1fe83c2b4d (svn r2639) -Add: Added the vehicle names in table/engines.h so that you know what line represents what vehicle (I hope I didn't mess that up). Added some comments while I'm at it and include the table/ directory in the Doxygen generation
celestar
parents: 1998
diff changeset
   104
/** Information about a vehicle
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4434
diff changeset
   105
 *  @see table/engines.h
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4434
diff changeset
   106
 */
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   107
struct EngineInfo {
4289
8981ce44336d (svn r5919) -Cleanup: use the type Date when the variable really is a date
rubidium
parents: 4077
diff changeset
   108
	Date base_intro;
4326
2e2c9d21ed96 (svn r5999) -Feature: change the original date format to a 32 bits format based at the year 0.
rubidium
parents: 4289
diff changeset
   109
	Year lifelength;
2e2c9d21ed96 (svn r5999) -Feature: change the original date format to a 32 bits format based at the year 0.
rubidium
parents: 4289
diff changeset
   110
	Year base_life;
9468
7087fa70cfd4 (svn r13388) -Codechange: Remove "my invented flag for something that is a wagon"
peter1138
parents: 9380
diff changeset
   111
	byte decay_speed;
5211
fb4dc0ca975d (svn r7326) -Feature: Add support for gradual (un)loading of vehicles (Maedhros)
peter1138
parents: 5187
diff changeset
   112
	byte load_amount;
5763
a6029daa547f (svn r8314) -Fix
tron
parents: 5668
diff changeset
   113
	byte climates;
2611
36aa372eeb34 (svn r3148) -NewGRF, Feature: Add support for cargo refitting specification by cargo classes.
peter1138
parents: 2602
diff changeset
   114
	uint32 refit_mask;
3997
8a997effbcec (svn r5201) - NewGRF: add loading of default refit costs. This information is not yet used
peter1138
parents: 3956
diff changeset
   115
	byte refit_cost;
3095
19084629d27a (svn r3684) - NewGRF: Support loading of miscellaneous flags (not used yet)
peter1138
parents: 3022
diff changeset
   116
	byte misc_flags;
3956
92362ba224b7 (svn r5105) - NewGRF: Move callbackmask from *VehicleInfo to EngineInfo. This simplifies code that works with more than one vehicle type.
peter1138
parents: 3866
diff changeset
   117
	byte callbackmask;
8509
84c0cc012ad3 (svn r12084) -Fix: 'Early retirement'-properties are signed.
frosch
parents: 8479
diff changeset
   118
	int8 retire_early;  ///< Number of years early to retire vehicle
8258
9fa31acb07bc (svn r11822) -Codechange: Replaced fixed size custom name array. Names are now attached to their object directly and there is
peter1138
parents: 8254
diff changeset
   119
	StringID string_id; ///< Default name of engine
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   120
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   121
3113
d79500c648da (svn r3717) - [2cc] Add 2cc colour maps and use for newgrf engines requiring them. Currently the second colour is fixed to be the player's colour.
peter1138
parents: 3095
diff changeset
   122
/**
d79500c648da (svn r3717) - [2cc] Add 2cc colour maps and use for newgrf engines requiring them. Currently the second colour is fixed to be the player's colour.
peter1138
parents: 3095
diff changeset
   123
 * EngineInfo.misc_flags is a bitmask, with the following values
d79500c648da (svn r3717) - [2cc] Add 2cc colour maps and use for newgrf engines requiring them. Currently the second colour is fixed to be the player's colour.
peter1138
parents: 3095
diff changeset
   124
 */
d79500c648da (svn r3717) - [2cc] Add 2cc colour maps and use for newgrf engines requiring them. Currently the second colour is fixed to be the player's colour.
peter1138
parents: 3095
diff changeset
   125
enum {
6685
00490513d7b1 (svn r9917) -Codechange: prepare some more areas for more road types.
rubidium
parents: 6643
diff changeset
   126
	EF_RAIL_TILTS = 0, ///< Rail vehicle tilts in curves
00490513d7b1 (svn r9917) -Codechange: prepare some more areas for more road types.
rubidium
parents: 6643
diff changeset
   127
	EF_ROAD_TRAM  = 0, ///< Road vehicle is a tram/light rail vehicle
3113
d79500c648da (svn r3717) - [2cc] Add 2cc colour maps and use for newgrf engines requiring them. Currently the second colour is fixed to be the player's colour.
peter1138
parents: 3095
diff changeset
   128
	EF_USES_2CC   = 1, ///< Vehicle uses two company colours
d79500c648da (svn r3717) - [2cc] Add 2cc colour maps and use for newgrf engines requiring them. Currently the second colour is fixed to be the player's colour.
peter1138
parents: 3095
diff changeset
   129
	EF_RAIL_IS_MU = 2, ///< Rail vehicle is a multiple-unit (DMU/EMU)
d79500c648da (svn r3717) - [2cc] Add 2cc colour maps and use for newgrf engines requiring them. Currently the second colour is fixed to be the player's colour.
peter1138
parents: 3095
diff changeset
   130
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   131
6174
0c743995213f (svn r8944) -Codechange: Move the enum describing the bitmask of Engine.flags to engine.h and give the enum values better names.
maedhros
parents: 6125
diff changeset
   132
/**
0c743995213f (svn r8944) -Codechange: Move the enum describing the bitmask of Engine.flags to engine.h and give the enum values better names.
maedhros
parents: 6125
diff changeset
   133
 * Engine.flags is a bitmask, with the following values.
0c743995213f (svn r8944) -Codechange: Move the enum describing the bitmask of Engine.flags to engine.h and give the enum values better names.
maedhros
parents: 6125
diff changeset
   134
 */
0c743995213f (svn r8944) -Codechange: Move the enum describing the bitmask of Engine.flags to engine.h and give the enum values better names.
maedhros
parents: 6125
diff changeset
   135
enum {
0c743995213f (svn r8944) -Codechange: Move the enum describing the bitmask of Engine.flags to engine.h and give the enum values better names.
maedhros
parents: 6125
diff changeset
   136
	ENGINE_AVAILABLE         = 1, ///< This vehicle is available to everyone.
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 10127
diff changeset
   137
	ENGINE_EXCLUSIVE_PREVIEW = 2, ///< This vehicle is in the exclusive preview stage, either being used or being offered to a company.
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 10127
diff changeset
   138
	ENGINE_OFFER_WINDOW_OPEN = 4, ///< The exclusive offer window is currently open for a company.
6174
0c743995213f (svn r8944) -Codechange: Move the enum describing the bitmask of Engine.flags to engine.h and give the enum values better names.
maedhros
parents: 6125
diff changeset
   139
};
0c743995213f (svn r8944) -Codechange: Move the enum describing the bitmask of Engine.flags to engine.h and give the enum values better names.
maedhros
parents: 6125
diff changeset
   140
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   141
enum {
9913
d9ce89020cc0 (svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium
parents: 9720
diff changeset
   142
	NUM_VEHICLE_TYPES             =   6,
d9ce89020cc0 (svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium
parents: 9720
diff changeset
   143
	MAX_LENGTH_ENGINE_NAME_BYTES  =  31, ///< The maximum length of an engine name in bytes including '\0'
d9ce89020cc0 (svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium
parents: 9720
diff changeset
   144
	MAX_LENGTH_ENGINE_NAME_PIXELS = 160, ///< The maximum length of an engine name in pixels
1802
da61740cc1e7 (svn r2306) - CodeChange: Check the last commands; refits. This needed an extensive rewrite and global/local-cargo ID juggling and bitmasking. However with this done it looks better as well and is compatible with newgrf handling. Big thanks to HackyKid for doing most of the work. This also closes patch "[ 1199277 ] Command checks"
Darkvater
parents: 1786
diff changeset
   145
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   146
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
   147
static const EngineID INVALID_ENGINE = 0xFFFF;
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
   148
8777
5ba12006e339 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium
parents: 8774
diff changeset
   149
#endif /* ENGINE_TYPE_H */