author | rubidium |
Wed, 19 Dec 2007 23:26:02 +0000 | |
changeset 8108 | b42a0e5c67ef |
parent 8106 | src/vehicle.h@e6790dd9e750 |
child 8144 | 65cec0877b78 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
8108
b42a0e5c67ef
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8106
diff
changeset
|
3 |
/** @file vehicle_type.h Types related to vehicles. */ |
5991
ec2eebfe86de
(svn r8698) -Codechange: enumify the returns of VehicleEnterTile
rubidium
parents:
5955
diff
changeset
|
4 |
|
8108
b42a0e5c67ef
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8106
diff
changeset
|
5 |
#ifndef VEHICLE_TYPE_H |
b42a0e5c67ef
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8106
diff
changeset
|
6 |
#define VEHICLE_TYPE_H |
6000
181ad2c1ab14
(svn r8715) -Codechange/cleanup: replace magic numbers related to state of road vehicles with enums. Original patch by mart3p.
rubidium
parents:
5991
diff
changeset
|
7 |
|
8108
b42a0e5c67ef
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8106
diff
changeset
|
8 |
#include "core/enum_type.hpp" |
6000
181ad2c1ab14
(svn r8715) -Codechange/cleanup: replace magic numbers related to state of road vehicles with enums. Original patch by mart3p.
rubidium
parents:
5991
diff
changeset
|
9 |
|
8108
b42a0e5c67ef
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8106
diff
changeset
|
10 |
typedef uint16 VehicleID; |
6000
181ad2c1ab14
(svn r8715) -Codechange/cleanup: replace magic numbers related to state of road vehicles with enums. Original patch by mart3p.
rubidium
parents:
5991
diff
changeset
|
11 |
|
6621
441559124aea
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
rubidium
parents:
6616
diff
changeset
|
12 |
enum VehicleType { |
6259
471b91a4b1d8
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6248
diff
changeset
|
13 |
VEH_TRAIN, |
471b91a4b1d8
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6248
diff
changeset
|
14 |
VEH_ROAD, |
471b91a4b1d8
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6248
diff
changeset
|
15 |
VEH_SHIP, |
471b91a4b1d8
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6248
diff
changeset
|
16 |
VEH_AIRCRAFT, |
471b91a4b1d8
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6248
diff
changeset
|
17 |
VEH_SPECIAL, |
471b91a4b1d8
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6248
diff
changeset
|
18 |
VEH_DISASTER, |
6621
441559124aea
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
rubidium
parents:
6616
diff
changeset
|
19 |
VEH_END, |
6259
471b91a4b1d8
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6248
diff
changeset
|
20 |
VEH_INVALID = 0xFF, |
6621
441559124aea
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
rubidium
parents:
6616
diff
changeset
|
21 |
}; |
7086
de7e83fb1602
(svn r10353) -Fix/Feature [FS#669]: disallow (in the GUI) the building of infrastructure you do not have available vehicles for. This means that the airport building button is disabled till you can actually build aircraft. The game itself will not disallow you to build the infrastructure and this "new" behaviour can be overriden with a patch setting.
rubidium
parents:
7066
diff
changeset
|
22 |
DECLARE_POSTFIX_INCREMENT(VehicleType); |
6621
441559124aea
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
rubidium
parents:
6616
diff
changeset
|
23 |
template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID> {}; |
441559124aea
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
rubidium
parents:
6616
diff
changeset
|
24 |
typedef TinyEnumT<VehicleType> VehicleTypeByte; |
1752
d65cd19f7117
(svn r2256) - Fix: Trains cannot find a depot when they are in a tunnel. (glx)
matthijs
parents:
1605
diff
changeset
|
25 |
|
7398
b933416cf32b
(svn r10770) -Codechange: use the pool item class as super class for the vehicle struct.
rubidium
parents:
7387
diff
changeset
|
26 |
struct Vehicle; |
7490
bb27d92565d3
(svn r11001) -Codechange: unify the way to determine whether a vehicle is in a depot.
rubidium
parents:
7488
diff
changeset
|
27 |
|
8108
b42a0e5c67ef
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8106
diff
changeset
|
28 |
#endif /* VEHICLE_TYPE_H */ |