30#include "TrainComponent.h"
34 struct SimulatorTrain;
46 static dclspc std::shared_ptr<Train>
Make() noexcept;
95 DistanceType distance = DistanceType::actual ) = 0;
196 virtual
void Reduce(
bool bRecursive = true ) noexcept = 0;
291 return Front( trainComponent.GetOrientation() );
295 return Back( trainComponent.GetOrientation() );
Value type, dependend from dimensions.
Definition DimensionedValues.h:233
RailRunner::EndType Front(Orientation orientation) noexcept
Get the front end of an oriented element.
Definition Train.h:282
RailRunner::EndType Back(Orientation orientation) noexcept
Get the back end of an oriented element.
Definition Train.h:286
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
A jack a plug can get connected with.
Definition Jack.h:83
Provides two values for orientation.
Definition Orientation.h:37
Interface for train and rolling stock that can be railed on a track and might provide brakes and powe...
Definition RailRunner.h:345
EndType
Types of the RailRunner's end's.
Definition RailRunner.h:351
@ south
Denotes the back end of a RailRunner.
Definition RailRunner.h:354
@ north
Denotes the front end of a RailRunner.
Definition RailRunner.h:353
A TrainComponent is a part of a Train.
Definition TrainComponent.h:40
A Train is a collection of TrainComponents that are coupled in a row.
Definition Train.h:43
virtual void Take(EndType atEnd, Train &fromTrain, EndType withEnd)=0
Takes all components from another Train.
virtual bool Couple(EndType thisEnd, Train &with, EndType withEnd) noexcept=0
Couples this Train with another at the respective ends.
virtual std::shared_ptr< Train > Separate()=0
Removes everything south of a broken internal coupling from this Train, and returns a new Train with ...
virtual std::pair< std::shared_ptr< Train >, std::shared_ptr< Train > > SplitAfter(int idxAt)=0
Splits this Train into two Trains at the specified index.
virtual int GetIndexOf(const TrainComponent &component) const noexcept=0
virtual void Align(EndType atEnd, TrainComponent &component, EndType withEnd) const =0
virtual int GetNumberOfComponents() const noexcept=0
virtual void Clear() noexcept=0
Removes all components from this train.
virtual bool IsUnCoupledInternally() const noexcept=0
virtual std::shared_ptr< TrainComponent > GetComponent(int index) const =0
Gets the TrainComponent at zero based index.
virtual std::shared_ptr< Train > ThisTrain() const noexcept=0
Gets a shared pointer to this.
static dclspc std::shared_ptr< Train > Make() noexcept
Makes a Train object.
virtual struct Jack & JackOnUnCoupleInternal() noexcept=0
Gets a Jack that pulses its Plug if a coupling inside the train (including all sub-Trains) is uncoupl...
virtual bool Create(TrainComponent &trainComponent, Orientation orientation=Orientation::Value::para)=0
virtual void Reduce(bool bRecursive=true) noexcept=0
Removes TrainComponents from this Train and includes them directly to the parent train....