summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-01-29 17:21:39 +0000
committerterkhen <terkhen@openttd.org>2011-01-29 17:21:39 +0000
commit23ffef05cec14ae23b6f778f1df4efa85410b3fb (patch)
treeaa25929a6cc395295079b0eac6325d3d89097d9e
parent3cd1f1552388b9eeeb6a9273e90df349da5b8b43 (diff)
downloadopenttd-23ffef05cec14ae23b6f778f1df4efa85410b3fb.tar.xz
(svn r21921) -Codechange: Move GroundVehicleSubtypeFlags as they will be needed by some Vehicle functions.
-rw-r--r--src/ground_vehicle.hpp13
-rw-r--r--src/vehicle_base.h14
2 files changed, 14 insertions, 13 deletions
diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp
index a4be384a6..e3fdb918b 100644
--- a/src/ground_vehicle.hpp
+++ b/src/ground_vehicle.hpp
@@ -243,19 +243,6 @@ struct GroundVehicle : public SpecializedVehicle<T, Type> {
}
/**
- * Enum to handle ground vehicle subtypes.
- * Do not access it directly unless you have to. Use the subtype access functions.
- */
- enum GroundVehicleSubtypeFlags {
- GVSF_FRONT = 0, ///< Leading engine of a consist.
- GVSF_ARTICULATED_PART = 1, ///< Articulated part of an engine.
- GVSF_WAGON = 2, ///< Wagon (not used for road vehicles).
- GVSF_ENGINE = 3, ///< Engine that can be front engine, but might be placed behind another engine (not used for road vehicles).
- GVSF_FREE_WAGON = 4, ///< First in a wagon chain (in depot) (not used for road vehicles).
- GVSF_MULTIHEADED = 5, ///< Engine is multiheaded (not used for road vehicles).
- };
-
- /**
* Set front engine state.
*/
FORCEINLINE void SetFrontEngine() { SetBit(this->subtype, GVSF_FRONT); }
diff --git a/src/vehicle_base.h b/src/vehicle_base.h
index e6e68d0a5..cc5e332d3 100644
--- a/src/vehicle_base.h
+++ b/src/vehicle_base.h
@@ -84,6 +84,20 @@ enum VisualEffect {
VE_DEFAULT = 0xFF, ///< Default value to indicate that visual effect should be based on engine class
};
+/**
+ * Enum to handle ground vehicle subtypes.
+ * This is defined here instead of at #GroundVehicle because some common function require access to these flags.
+ * Do not access it directly unless you have to. Use the subtype access functions.
+ */
+enum GroundVehicleSubtypeFlags {
+ GVSF_FRONT = 0, ///< Leading engine of a consist.
+ GVSF_ARTICULATED_PART = 1, ///< Articulated part of an engine.
+ GVSF_WAGON = 2, ///< Wagon (not used for road vehicles).
+ GVSF_ENGINE = 3, ///< Engine that can be front engine, but might be placed behind another engine (not used for road vehicles).
+ GVSF_FREE_WAGON = 4, ///< First in a wagon chain (in depot) (not used for road vehicles).
+ GVSF_MULTIHEADED = 5, ///< Engine is multiheaded (not used for road vehicles).
+};
+
/** Cached often queried values common to all vehicles. */
struct VehicleCache {
uint16 cached_max_speed; ///< Maximum speed of the consist (minimum of the max speed of all vehicles in the consist).