author | truebrain |
Mon, 30 Jun 2008 13:36:06 +0000 | |
branch | noai |
changeset 11100 | b960288098b9 |
parent 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" |
|
9 |
||
10 |
typedef uint16 VehicleID; |
|
11 |
||
12 |
enum VehicleType { |
|
13 |
VEH_TRAIN, |
|
14 |
VEH_ROAD, |
|
15 |
VEH_SHIP, |
|
16 |
VEH_AIRCRAFT, |
|
10294 | 17 |
VEH_EFFECT, |
9723 | 18 |
VEH_DISASTER, |
19 |
VEH_END, |
|
20 |
VEH_INVALID = 0xFF, |
|
21 |
}; |
|
22 |
DECLARE_POSTFIX_INCREMENT(VehicleType); |
|
23 |
template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID> {}; |
|
24 |
typedef TinyEnumT<VehicleType> VehicleTypeByte; |
|
25 |
||
26 |
struct Vehicle; |
|
27 |
||
28 |
struct BaseVehicle |
|
29 |
{ |
|
30 |
VehicleTypeByte type; ///< Type of vehicle |
|
31 |
||
32 |
/** |
|
33 |
* Is this vehicle a valid vehicle? |
|
34 |
* @return true if and only if the vehicle is valid. |
|
35 |
*/ |
|
36 |
inline bool IsValid() const { return this->type != VEH_INVALID; } |
|
37 |
}; |
|
38 |
||
39 |
static const VehicleID INVALID_VEHICLE = 0xFFFF; |
|
40 |
||
9732 | 41 |
/** Pathfinding option states */ |
42 |
enum { |
|
43 |
VPF_OPF = 0, ///< The Original PathFinder |
|
44 |
VPF_NTP = 0, ///< New Train Pathfinder, replacing OPF for trains |
|
45 |
VPF_NPF = 1, ///< New PathFinder |
|
46 |
VPF_YAPF = 2, ///< Yet Another PathFinder |
|
47 |
}; |
|
48 |
||
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
|
49 |
/* 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
|
50 |
/* 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
|
51 |
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
|
52 |
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
|
53 |
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
|
54 |
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
|
55 |
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
|
56 |
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
|
57 |
}; |
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 |
|
9723 | 59 |
#endif /* VEHICLE_TYPE_H */ |