diff options
author | terkhen <terkhen@openttd.org> | 2011-01-19 20:04:09 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2011-01-19 20:04:09 +0000 |
commit | d426906a010f9e7355986400edcbe1d84b6a70e2 (patch) | |
tree | cbcbd03e43978909338f73f3dbb075e01d26216e /src/train.h | |
parent | be44f1306f633448e88b0a460205b1a6af927218 (diff) | |
download | openttd-d426906a010f9e7355986400edcbe1d84b6a70e2.tar.xz |
(svn r21862) -Codechange: Unify subtype handling between road vehicles and trains.
Diffstat (limited to 'src/train.h')
-rw-r--r-- | src/train.h | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/src/train.h b/src/train.h index 55c273faa..f20bdd582 100644 --- a/src/train.h +++ b/src/train.h @@ -138,116 +138,6 @@ struct Train : public GroundVehicle<Train, VEH_TRAIN> { int GetCurrentMaxSpeed() const; /** - * Set front engine state - */ - FORCEINLINE void SetFrontEngine() { SetBit(this->subtype, GVSF_FRONT); } - - /** - * Remove the front engine state - */ - FORCEINLINE void ClearFrontEngine() { ClrBit(this->subtype, GVSF_FRONT); } - - /** - * Set a vehicle to be an articulated part - */ - FORCEINLINE void SetArticulatedPart() { SetBit(this->subtype, GVSF_ARTICULATED_PART); } - - /** - * Clear a vehicle from being an articulated part - */ - FORCEINLINE void ClearArticulatedPart() { ClrBit(this->subtype, GVSF_ARTICULATED_PART); } - - /** - * Set a vehicle to be a wagon - */ - FORCEINLINE void SetWagon() { SetBit(this->subtype, GVSF_WAGON); } - - /** - * Clear wagon property - */ - FORCEINLINE void ClearWagon() { ClrBit(this->subtype, GVSF_WAGON); } - - /** - * Set engine status - */ - FORCEINLINE void SetEngine() { SetBit(this->subtype, GVSF_ENGINE); } - - /** - * Clear engine status - */ - FORCEINLINE void ClearEngine() { ClrBit(this->subtype, GVSF_ENGINE); } - - /** - * Set if a vehicle is a free wagon - */ - FORCEINLINE void SetFreeWagon() { SetBit(this->subtype, GVSF_FREE_WAGON); } - - /** - * Clear a vehicle from being a free wagon - */ - FORCEINLINE void ClearFreeWagon() { ClrBit(this->subtype, GVSF_FREE_WAGON); } - - /** - * Set if a vehicle is a multiheaded engine - */ - FORCEINLINE void SetMultiheaded() { SetBit(this->subtype, GVSF_MULTIHEADED); } - - /** - * Clear multiheaded engine property - */ - FORCEINLINE void ClearMultiheaded() { ClrBit(this->subtype, GVSF_MULTIHEADED); } - - - /** - * Check if train is a front engine - * @return Returns true if train is a front engine - */ - FORCEINLINE bool IsFrontEngine() const { return HasBit(this->subtype, GVSF_FRONT); } - - /** - * Check if train is a free wagon (got no engine in front of it) - * @return Returns true if train is a free wagon - */ - FORCEINLINE bool IsFreeWagon() const { return HasBit(this->subtype, GVSF_FREE_WAGON); } - - /** - * Check if a vehicle is an engine (can be first in a train) - * @return Returns true if vehicle is an engine - */ - FORCEINLINE bool IsEngine() const { return HasBit(this->subtype, GVSF_ENGINE); } - - /** - * Check if a train is a wagon - * @return Returns true if vehicle is a wagon - */ - FORCEINLINE bool IsWagon() const { return HasBit(this->subtype, GVSF_WAGON); } - - /** - * Check if train is a multiheaded engine - * @return Returns true if vehicle is a multiheaded engine - */ - FORCEINLINE bool IsMultiheaded() const { return HasBit(this->subtype, GVSF_MULTIHEADED); } - - /** - * Tell if we are dealing with the rear end of a multiheaded engine. - * @return True if the engine is the rear part of a dualheaded engine. - */ - FORCEINLINE bool IsRearDualheaded() const { return this->IsMultiheaded() && !this->IsEngine(); } - - /** - * Check if train is an articulated part of an engine - * @return Returns true if train is an articulated part - */ - FORCEINLINE bool IsArticulatedPart() const { return HasBit(this->subtype, GVSF_ARTICULATED_PART); } - - /** - * Check if an engine has an articulated part. - * @return True if the engine has an articulated part. - */ - FORCEINLINE bool HasArticulatedPart() const { return this->Next() != NULL && this->Next()->IsArticulatedPart(); } - - - /** * Get the next part of a multi-part engine. * Will only work on a multi-part engine (this->EngineHasArticPart() == true), * Result is undefined for normal engine. |