summaryrefslogtreecommitdiff
path: root/src/train.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/train.h')
-rw-r--r--src/train.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/train.h b/src/train.h
index 8f4bc2a9b..280d59ebd 100644
--- a/src/train.h
+++ b/src/train.h
@@ -12,6 +12,8 @@
#ifndef TRAIN_H
#define TRAIN_H
+#include "core/enum_type.hpp"
+
#include "newgrf_engine.h"
#include "cargotype.h"
#include "rail.h"
@@ -41,6 +43,20 @@ enum TrainForceProceeding {
};
typedef SimpleTinyEnumT<TrainForceProceeding, byte> TrainForceProceedingByte;
+/** Flags for Train::ConsistChanged */
+enum ConsistChangeFlags {
+ CCF_LENGTH = 0x01, ///< Allow vehicles to change length.
+ CCF_CAPACITY = 0x02, ///< Allow vehicles to change capacity.
+
+ CCF_TRACK = 0, ///< Valid changes while vehicle is driving, and possibly changing tracks.
+ CCF_LOADUNLOAD = 0, ///< Valid changes while vehicle is loading/unloading.
+ CCF_AUTOREFIT = CCF_CAPACITY, ///< Valid changes for autorefitting in stations.
+ CCF_REFIT = CCF_LENGTH | CCF_CAPACITY, ///< Valid changes for refitting in a depot.
+ CCF_ARRANGE = CCF_LENGTH | CCF_CAPACITY, ///< Valid changes for arranging the consist in a depot.
+ CCF_SAVELOAD = CCF_LENGTH, ///< Valid changes when loading a savegame. (Everything that is not stored in the save.)
+};
+DECLARE_ENUM_AS_BIT_SET(ConsistChangeFlags)
+
byte FreightWagonMult(CargoID cargo);
void CheckTrainsLengths();
@@ -115,7 +131,7 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
int GetCurveSpeedLimit() const;
- void ConsistChanged(bool same_length);
+ void ConsistChanged(ConsistChangeFlags allowed_changes);
int UpdateSpeed();