author | peter1138 |
Tue, 17 Jun 2008 07:05:17 +0000 | |
changeset 10990 | 787c5664f30b |
parent 10757 | 7f002e778125 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
8604
8afdd9877afd
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8602
diff
changeset
|
3 |
/** @file vehicle_type.h Types related to vehicles. */ |
6317
c73bda71ac16
(svn r8698) -Codechange: enumify the returns of VehicleEnterTile
rubidium
parents:
6206
diff
changeset
|
4 |
|
8604
8afdd9877afd
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8602
diff
changeset
|
5 |
#ifndef VEHICLE_TYPE_H |
8afdd9877afd
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8602
diff
changeset
|
6 |
#define VEHICLE_TYPE_H |
6326
c904c7ea1c8d
(svn r8715) -Codechange/cleanup: replace magic numbers related to state of road vehicles with enums. Original patch by mart3p.
rubidium
parents:
6317
diff
changeset
|
7 |
|
8604
8afdd9877afd
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8602
diff
changeset
|
8 |
#include "core/enum_type.hpp" |
6326
c904c7ea1c8d
(svn r8715) -Codechange/cleanup: replace magic numbers related to state of road vehicles with enums. Original patch by mart3p.
rubidium
parents:
6317
diff
changeset
|
9 |
|
8604
8afdd9877afd
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8602
diff
changeset
|
10 |
typedef uint16 VehicleID; |
6326
c904c7ea1c8d
(svn r8715) -Codechange/cleanup: replace magic numbers related to state of road vehicles with enums. Original patch by mart3p.
rubidium
parents:
6317
diff
changeset
|
11 |
|
7117
866a75f1ac5e
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
rubidium
parents:
7112
diff
changeset
|
12 |
enum VehicleType { |
6585
7da94b26498a
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6574
diff
changeset
|
13 |
VEH_TRAIN, |
7da94b26498a
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6574
diff
changeset
|
14 |
VEH_ROAD, |
7da94b26498a
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6574
diff
changeset
|
15 |
VEH_SHIP, |
7da94b26498a
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6574
diff
changeset
|
16 |
VEH_AIRCRAFT, |
10271
a20997d33fe8
(svn r12803) -Cleanup: rename SpecialVehicle to EffectVehicle to have a uniform naming of the thing instead of using both names for the same thing.
rubidium
parents:
10127
diff
changeset
|
17 |
VEH_EFFECT, |
6585
7da94b26498a
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6574
diff
changeset
|
18 |
VEH_DISASTER, |
7117
866a75f1ac5e
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
rubidium
parents:
7112
diff
changeset
|
19 |
VEH_END, |
6585
7da94b26498a
(svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents:
6574
diff
changeset
|
20 |
VEH_INVALID = 0xFF, |
7117
866a75f1ac5e
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
rubidium
parents:
7112
diff
changeset
|
21 |
}; |
7582
9f23c01ae23d
(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:
7562
diff
changeset
|
22 |
DECLARE_POSTFIX_INCREMENT(VehicleType); |
7117
866a75f1ac5e
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
rubidium
parents:
7112
diff
changeset
|
23 |
template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID> {}; |
866a75f1ac5e
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
rubidium
parents:
7112
diff
changeset
|
24 |
typedef TinyEnumT<VehicleType> VehicleTypeByte; |
1752
cdbfb2f23e72
(svn r2256) - Fix: Trains cannot find a depot when they are in a tunnel. (glx)
matthijs
parents:
1605
diff
changeset
|
25 |
|
7894
dbe6e9295ec5
(svn r10770) -Codechange: use the pool item class as super class for the vehicle struct.
rubidium
parents:
7883
diff
changeset
|
26 |
struct Vehicle; |
7986
881998b115c2
(svn r11001) -Codechange: unify the way to determine whether a vehicle is in a depot.
rubidium
parents:
7984
diff
changeset
|
27 |
|
8640
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
28 |
struct BaseVehicle |
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
29 |
{ |
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
30 |
VehicleTypeByte type; ///< Type of vehicle |
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
31 |
|
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
32 |
/** |
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
33 |
* Is this vehicle a valid vehicle? |
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
34 |
* @return true if and only if the vehicle is valid. |
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
35 |
*/ |
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
36 |
inline bool IsValid() const { return this->type != VEH_INVALID; } |
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
37 |
}; |
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
38 |
|
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
39 |
static const VehicleID INVALID_VEHICLE = 0xFFFF; |
1e93b81e96d2
(svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes.
rubidium
parents:
8604
diff
changeset
|
40 |
|
9047
4dce11366b62
(svn r12129) -Change [FS#1759]: simplified patch settings for pathfinders (Yorick)
smatz
parents:
8640
diff
changeset
|
41 |
/** Pathfinding option states */ |
4dce11366b62
(svn r12129) -Change [FS#1759]: simplified patch settings for pathfinders (Yorick)
smatz
parents:
8640
diff
changeset
|
42 |
enum { |
4dce11366b62
(svn r12129) -Change [FS#1759]: simplified patch settings for pathfinders (Yorick)
smatz
parents:
8640
diff
changeset
|
43 |
VPF_OPF = 0, ///< The Original PathFinder |
4dce11366b62
(svn r12129) -Change [FS#1759]: simplified patch settings for pathfinders (Yorick)
smatz
parents:
8640
diff
changeset
|
44 |
VPF_NTP = 0, ///< New Train Pathfinder, replacing OPF for trains |
4dce11366b62
(svn r12129) -Change [FS#1759]: simplified patch settings for pathfinders (Yorick)
smatz
parents:
8640
diff
changeset
|
45 |
VPF_NPF = 1, ///< New PathFinder |
4dce11366b62
(svn r12129) -Change [FS#1759]: simplified patch settings for pathfinders (Yorick)
smatz
parents:
8640
diff
changeset
|
46 |
VPF_YAPF = 2, ///< Yet Another PathFinder |
4dce11366b62
(svn r12129) -Change [FS#1759]: simplified patch settings for pathfinders (Yorick)
smatz
parents:
8640
diff
changeset
|
47 |
}; |
4dce11366b62
(svn r12129) -Change [FS#1759]: simplified patch settings for pathfinders (Yorick)
smatz
parents:
8640
diff
changeset
|
48 |
|
10127
ab5e35f77e87
(svn r12658) -Codechange: unify a vast portion of the CmdSend<VehicleType>ToDepot commands.
rubidium
parents:
9047
diff
changeset
|
49 |
/* Flags to add to p2 for goto depot commands */ |
ab5e35f77e87
(svn r12658) -Codechange: unify a vast portion of the CmdSend<VehicleType>ToDepot commands.
rubidium
parents:
9047
diff
changeset
|
50 |
/* Note: bits 8-10 are used for VLW flags */ |
ab5e35f77e87
(svn r12658) -Codechange: unify a vast portion of the CmdSend<VehicleType>ToDepot commands.
rubidium
parents:
9047
diff
changeset
|
51 |
enum DepotCommand { |
ab5e35f77e87
(svn r12658) -Codechange: unify a vast portion of the CmdSend<VehicleType>ToDepot commands.
rubidium
parents:
9047
diff
changeset
|
52 |
DEPOT_SERVICE = (1 << 0), ///< The vehicle will leave the depot right after arrival (serivce only) |
ab5e35f77e87
(svn r12658) -Codechange: unify a vast portion of the CmdSend<VehicleType>ToDepot commands.
rubidium
parents:
9047
diff
changeset
|
53 |
DEPOT_MASS_SEND = (1 << 1), ///< Tells that it's a mass send to depot command (type in VLW flag) |
ab5e35f77e87
(svn r12658) -Codechange: unify a vast portion of the CmdSend<VehicleType>ToDepot commands.
rubidium
parents:
9047
diff
changeset
|
54 |
DEPOT_DONT_CANCEL = (1 << 2), ///< Don't cancel current goto depot command if any |
ab5e35f77e87
(svn r12658) -Codechange: unify a vast portion of the CmdSend<VehicleType>ToDepot commands.
rubidium
parents:
9047
diff
changeset
|
55 |
DEPOT_LOCATE_HANGAR = (1 << 3), ///< Find another airport if the target one lacks a hangar |
ab5e35f77e87
(svn r12658) -Codechange: unify a vast portion of the CmdSend<VehicleType>ToDepot commands.
rubidium
parents:
9047
diff
changeset
|
56 |
DEPOT_COMMAND_MASK = 0xF, |
ab5e35f77e87
(svn r12658) -Codechange: unify a vast portion of the CmdSend<VehicleType>ToDepot commands.
rubidium
parents:
9047
diff
changeset
|
57 |
}; |
ab5e35f77e87
(svn r12658) -Codechange: unify a vast portion of the CmdSend<VehicleType>ToDepot commands.
rubidium
parents:
9047
diff
changeset
|
58 |
|
8604
8afdd9877afd
(svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents:
8602
diff
changeset
|
59 |
#endif /* VEHICLE_TYPE_H */ |