diff options
Diffstat (limited to 'src/train.h')
-rw-r--r-- | src/train.h | 70 |
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. */ |