summaryrefslogtreecommitdiff
path: root/src/train.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-22 22:33:05 +0000
committerrubidium <rubidium@openttd.org>2009-05-22 22:33:05 +0000
commitc4b627af422075ce4a0e1026c52f871dd3f146c0 (patch)
treefebaea249dc307b4b619aeff09e353677bbbcd84 /src/train.h
parent80e94b9bb15f846189e98f1f457afe2b96ba2b58 (diff)
downloadopenttd-c4b627af422075ce4a0e1026c52f871dd3f146c0.tar.xz
(svn r16392) -Codechange: move some variables (the ones that aren't caches) from VehicleRail to Train
Diffstat (limited to 'src/train.h')
-rw-r--r--src/train.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/train.h b/src/train.h
index 86c8c8a21..95b128f9e 100644
--- a/src/train.h
+++ b/src/train.h
@@ -11,6 +11,33 @@
struct Train;
+enum VehicleRailFlags {
+ VRF_REVERSING = 0,
+
+ /* used to calculate if train is going up or down */
+ VRF_GOINGUP = 1,
+ VRF_GOINGDOWN = 2,
+
+ /* used to store if a wagon is powered or not */
+ VRF_POWEREDWAGON = 3,
+
+ /* used to reverse the visible direction of the vehicle */
+ VRF_REVERSE_DIRECTION = 4,
+
+ /* used to mark train as lost because PF can't find the route */
+ VRF_NO_PATH_TO_DESTINATION = 5,
+
+ /* used to mark that electric train engine is allowed to run on normal rail */
+ VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL = 6,
+
+ /* used for vehicle var 0xFE bit 8 (toggled each time the train is reversed, accurate for first vehicle only) */
+ VRF_TOGGLE_REVERSE = 7,
+
+ /* used to mark a train that can't get a path reservation */
+ VRF_TRAIN_STUCK = 8,
+};
+
+
/** enum to handle train subtypes
* Do not access it directly unless you have to. Use the access functions below
* This is an enum to tell what bit to access as it is a bitmask
@@ -241,6 +268,17 @@ Money GetTrainRunningCost(const Train *v);
* As side-effect the vehicle type is set correctly.
*/
struct Train : public Vehicle {
+ /* Link between the two ends of a multiheaded engine */
+ Train *other_multiheaded_part;
+
+ uint16 crash_anim_pos;
+
+ uint16 flags;
+ TrackBitsByte track;
+ byte force_proceed;
+ RailTypeByte railtype;
+ RailTypes compatible_railtypes;
+
/** Initializes the Vehicle to a train */
Train() { this->type = VEH_TRAIN; }