author | rubidium |
Mon, 26 May 2008 13:52:59 +0000 | |
branch | noai |
changeset 10715 | 6bdf79ffb022 |
parent 10294 | 7798ae816af8 |
child 10776 | 07203fc29812 |
permissions | -rw-r--r-- |
9723 | 1 |
/* $Id$ */ |
2 |
||
3 |
/** @file vehicle_type.h Types related to vehicles. */ |
|
4 |
||
5 |
#ifndef VEHICLE_TYPE_H |
|
6 |
#define VEHICLE_TYPE_H |
|
7 |
||
8 |
#include "core/enum_type.hpp" |
|
10715
6bdf79ffb022
(svn r13265) [NoAI] -Sync with trunk r13185:13264.
rubidium
parents:
10294
diff
changeset
|
9 |
#include "misc/smallvec.h" |
9723 | 10 |
|
11 |
typedef uint16 VehicleID; |
|
12 |
||
13 |
enum VehicleType { |
|
14 |
VEH_TRAIN, |
|
15 |
VEH_ROAD, |
|
16 |
VEH_SHIP, |
|
17 |
VEH_AIRCRAFT, |
|
10294 | 18 |
VEH_EFFECT, |
9723 | 19 |
VEH_DISASTER, |
20 |
VEH_END, |
|
21 |
VEH_INVALID = 0xFF, |
|
22 |
}; |
|
23 |
DECLARE_POSTFIX_INCREMENT(VehicleType); |
|
24 |
template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID> {}; |
|
25 |
typedef TinyEnumT<VehicleType> VehicleTypeByte; |
|
26 |
||
27 |
struct Vehicle; |
|
28 |
||
29 |
struct BaseVehicle |
|
30 |
{ |
|
31 |
VehicleTypeByte type; ///< Type of vehicle |
|
32 |
||
33 |
/** |
|
34 |
* Is this vehicle a valid vehicle? |
|
35 |
* @return true if and only if the vehicle is valid. |
|
36 |
*/ |
|
37 |
inline bool IsValid() const { return this->type != VEH_INVALID; } |
|
38 |
}; |
|
39 |
||
40 |
static const VehicleID INVALID_VEHICLE = 0xFFFF; |
|
41 |
||
9732 | 42 |
/** Pathfinding option states */ |
43 |
enum { |
|
44 |
VPF_OPF = 0, ///< The Original PathFinder |
|
45 |
VPF_NTP = 0, ///< New Train Pathfinder, replacing OPF for trains |
|
46 |
VPF_NPF = 1, ///< New PathFinder |
|
47 |
VPF_YAPF = 2, ///< Yet Another PathFinder |
|
48 |
}; |
|
49 |
||
10142
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9732
diff
changeset
|
50 |
/* Flags to add to p2 for goto depot commands */ |
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9732
diff
changeset
|
51 |
/* Note: bits 8-10 are used for VLW flags */ |
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9732
diff
changeset
|
52 |
enum DepotCommand { |
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9732
diff
changeset
|
53 |
DEPOT_SERVICE = (1 << 0), ///< The vehicle will leave the depot right after arrival (serivce only) |
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9732
diff
changeset
|
54 |
DEPOT_MASS_SEND = (1 << 1), ///< Tells that it's a mass send to depot command (type in VLW flag) |
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9732
diff
changeset
|
55 |
DEPOT_DONT_CANCEL = (1 << 2), ///< Don't cancel current goto depot command if any |
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9732
diff
changeset
|
56 |
DEPOT_LOCATE_HANGAR = (1 << 3), ///< Find another airport if the target one lacks a hangar |
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9732
diff
changeset
|
57 |
DEPOT_COMMAND_MASK = 0xF, |
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9732
diff
changeset
|
58 |
}; |
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9732
diff
changeset
|
59 |
|
10715
6bdf79ffb022
(svn r13265) [NoAI] -Sync with trunk r13185:13264.
rubidium
parents:
10294
diff
changeset
|
60 |
typedef SmallVector<const Vehicle*, 32> VehicleList; |
6bdf79ffb022
(svn r13265) [NoAI] -Sync with trunk r13185:13264.
rubidium
parents:
10294
diff
changeset
|
61 |
|
9723 | 62 |
#endif /* VEHICLE_TYPE_H */ |