summaryrefslogtreecommitdiff
path: root/src/train.h
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2011-01-29 17:27:32 +0000
committerterkhen <terkhen@openttd.org>2011-01-29 17:27:32 +0000
commit50b0e1002621720c6b2cd4b8e20856b86da0b61d (patch)
treee71c1467799904e8902b9a3597d744260d306cb2 /src/train.h
parent9626e0bf2bb87c7e0957b65069527c26b0da4a34 (diff)
downloadopenttd-50b0e1002621720c6b2cd4b8e20856b86da0b61d.tar.xz
(svn r21923) -Codechange: Unify articulated vehicle iteration functions.
Diffstat (limited to 'src/train.h')
-rw-r--r--src/train.h70
1 files changed, 0 insertions, 70 deletions
diff --git a/src/train.h b/src/train.h
index 1d153337c..e416dd3d9 100644
--- a/src/train.h
+++ b/src/train.h
@@ -136,76 +136,6 @@ struct Train : public GroundVehicle<Train, VEH_TRAIN> {
int GetCurrentMaxSpeed() const;
/**
- * 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.
- * @return next part of articulated engine
- */
- FORCEINLINE Train *GetNextArticulatedPart() const
- {
- assert(this->HasArticulatedPart());
- return this->Next();
- }
-
- /**
- * Get the first part of a multi-part engine.
- * @return First part of the engine.
- */
- FORCEINLINE Train *GetFirstEnginePart()
- {
- Train *v = this;
- while (v->IsArticulatedPart()) v = v->Previous();
- return v;
- }
-
- /**
- * Get the first part of a multi-part engine.
- * @return First part of the engine.
- */
- FORCEINLINE const Train *GetFirstEnginePart() const
- {
- const Train *v = this;
- while (v->IsArticulatedPart()) v = v->Previous();
- return v;
- }
-
- /**
- * Get the last part of a multi-part engine.
- * @return Last part of the engine.
- */
- FORCEINLINE Train *GetLastEnginePart()
- {
- Train *v = this;
- while (v->HasArticulatedPart()) v = v->GetNextArticulatedPart();
- return v;
- }
-
- /**
- * Get the next real (non-articulated part) vehicle in the consist.
- * @return Next vehicle in the consist.
- */
- FORCEINLINE Train *GetNextVehicle() const
- {
- const Train *v = this;
- while (v->HasArticulatedPart()) v = v->GetNextArticulatedPart();
-
- /* v now contains the last artic part in the engine */
- return v->Next();
- }
-
- /**
- * Get the previous real (non-articulated part) vehicle in the consist.
- * @return Previous vehicle in the consist.
- */
- FORCEINLINE Train *GetPrevVehicle() const
- {
- Train *v = this->Previous();
- while (v != NULL && v->IsArticulatedPart()) v = v->Previous();
-
- return v;
- }
-
- /**
* Get the next real (non-articulated part and non rear part of dualheaded engine) vehicle in the consist.
* @return Next vehicle in the consist.
*/