Model Railroad System 2.2.2
|
The Train class represents a train. More...
#include <Train.h>
Classes | |
union | StationOrIndustry |
Union of stations or industries, used for stops. More... | |
Public Types | |
enum | TrainType { Unknown = 0 , Wayfreight = 'W' , BoxMove = 'B' , Manifest = 'M' , Passenger = 'P' } |
Types of trains. More... | |
Public Member Functions | |
Train () | |
Default constructor. More... | |
Train (Train &other) | |
Copy construtor. More... | |
Train & | operator= (Train &other) |
Assignment operator. More... | |
Train (const char *n, const char *dl, const char *ct, const char *descr, int sh, int mc, int mcl, int mw, int ml, int od, bool p, bool d, TrainType t) | |
Full constructor. More... | |
~Train () | |
Descructor. More... | |
const char * | Name () const |
Return the train's name. More... | |
const char * | DivisionList () const |
Return the train's division list (string of symbols). More... | |
const char * | CarTypes () const |
Return the train's car type list (string of char type characters). More... | |
const char * | Description () const |
Return the train's description. More... | |
int | Shift () const |
Return the train's shift. More... | |
void | SetShift (int newshift) |
Set the train's shift. More... | |
int | MaxCars () const |
Return the train's maximum number of cars. More... | |
int | MaxClear () const |
Return the train's maximum clearance plate. More... | |
int | MaxWeight () const |
Return the train's maximum weight class. More... | |
void | SetMaxWeight (int newmaxweight) |
Set the train's maximum weight class. More... | |
int | MaxLength () const |
Return the train's maximum length. More... | |
void | SetMaxLength (int newmaxlength) |
Set the train's maximum length. More... | |
int | OnDuty () const |
Return the train's on duty time, in minutes since midnight. More... | |
bool | Print () const |
Return the train's print flag. More... | |
void | SetPrint (bool flag) |
Set the train's print flag. More... | |
bool | Done () const |
Return the train's done flag. More... | |
TrainType | Type () const |
Return the train's type. More... | |
int | NumberOfOrders () const |
Return the number of train orders for this train. More... | |
const char * | Order (int index) const |
Return the Ith order. More... | |
int | NumberOfStops () const |
Return the number of stops this train makes. More... | |
FCFSupport::Industry * | IndustryStop (int index) const |
Return the Ith industry stop this train makes. More... | |
Station * | StationStop (int index) const |
Return the Ith station stop this train makes. More... | |
Private Attributes | |
vector< string > | orders |
List of train orders. More... | |
vector< StationOrIndustry > | stops |
List of stops. More... | |
string | name |
Name of the train. More... | |
string | divList |
The list of division symbols for this train. More... | |
string | carTypes |
The list of car type charactes. More... | |
string | description |
The description of the train. More... | |
int | shift |
The train's shift. More... | |
int | maxcars |
The maximum number of cars on this train. More... | |
int | maxclear |
The maximum clearance plate for this train. More... | |
int | maxweight |
The maximum weight class for this train. More... | |
int | maxlength |
The maximum length for this train. More... | |
int | onduty |
The onduty time for this train, in minutes since midnight. More... | |
bool | |
The print flag for this train. More... | |
bool | done |
The done flag for this train. More... | |
TrainType | type |
The type of this train. More... | |
Friends | |
class | System |
The System class is a friend. More... | |
The Train class represents a train.
A train has a name, a type, a description, a list of divisions it operates in, it takes a specific set of car types, operates during a specific shift (or possibly all shifts if it is a box movement), a set of stops it makes, an on duty time, a maximum number of cars, a maximum clearance plate, a maximum weight class, a maximum length and several flags.
|
inline |
|
inline |
|
inline |
Full constructor.
Initialize the class instance from a set of parameters.
n | The new train's name. |
dl | The new train's division list. |
ct | The new train's car type list. |
descr | The New train's description. |
sh | The new train's shift. |
mc | The new train's maximum car limit. |
mcl | The new train's maximum clearance plate. |
mw | The new train's maximum weight class. |
ml | The new train's maximum length. |
od | The new train's on duty time (in minutes since midnight). |
p | A flag to indicate if a pickup / dropoff sheet should be printed for this train. |
d | A flag to indicate if this train is done. |
t | The new train's type. |
References carTypes, description, divList, done, maxcars, maxclear, maxlength, maxweight, name, onduty, print, shift, and type.
|
inline |
Descructor.
|
inline |
Return the train's car type list (string of char type characters).
References carTypes.
|
inline |
Return the train's description.
References description.
|
inline |
Return the train's division list (string of symbols).
References divList.
|
inline |
Return the train's done flag.
References done.
|
inline |
Return the Ith industry stop this train makes.
index | The index of the the stop to retrieve. |
References Manifest, stops, and type.
Referenced by FCFSupport::SwitchListElement::DropStopEQ().
|
inline |
Return the train's maximum number of cars.
References maxcars.
|
inline |
Return the train's maximum clearance plate.
References maxclear.
|
inline |
Return the train's maximum length.
References maxlength.
|
inline |
Return the train's maximum weight class.
References maxweight.
|
inline |
Return the train's name.
References name.
|
inline |
Return the number of train orders for this train.
References orders.
|
inline |
Return the number of stops this train makes.
References stops.
|
inline |
Return the train's on duty time, in minutes since midnight.
References onduty.
|
inline |
|
inline |
Return the train's print flag.
References print.
|
inline |
|
inline |
Set the train's maximum weight class.
newmaxweight | New maximum weight class. |
References maxweight.
|
inline |
|
inline |
|
inline |
Return the train's shift.
References shift.
|
inline |
Return the Ith station stop this train makes.
index | The index of the the stop to retrieve. |
References Manifest, stops, and type.
Referenced by FCFSupport::SwitchListElement::DropStopEQ().
|
inline |
Return the train's type.
References type.
Referenced by FCFSupport::SwitchListElement::DropStopEQ(), FCFSupport::SwitchListElement::DropStopIndustry(), and FCFSupport::SwitchListElement::DropStopStation().
|
private |
The list of car type charactes.
Referenced by CarTypes(), operator=(), and Train().
|
private |
The description of the train.
Referenced by Description(), operator=(), and Train().
|
private |
The list of division symbols for this train.
Referenced by DivisionList(), operator=(), and Train().
|
private |
The done flag for this train.
Referenced by Done(), operator=(), and Train().
|
private |
The maximum number of cars on this train.
Referenced by MaxCars(), operator=(), and Train().
|
private |
The maximum clearance plate for this train.
Referenced by MaxClear(), operator=(), and Train().
|
private |
The maximum length for this train.
Referenced by MaxLength(), operator=(), SetMaxLength(), and Train().
|
private |
The maximum weight class for this train.
Referenced by MaxWeight(), operator=(), SetMaxWeight(), and Train().
|
private |
Name of the train.
Referenced by Name(), operator=(), and Train().
|
private |
The onduty time for this train, in minutes since midnight.
Referenced by OnDuty(), operator=(), and Train().
|
private |
List of train orders.
Referenced by NumberOfOrders(), operator=(), Order(), and Train().
|
private |
The print flag for this train.
Referenced by operator=(), Print(), SetPrint(), and Train().
|
private |
The train's shift.
Referenced by operator=(), SetShift(), Shift(), and Train().
|
private |
List of stops.
Referenced by IndustryStop(), NumberOfStops(), operator=(), StationStop(), and Train().
|
private |
The type of this train.
Referenced by IndustryStop(), operator=(), StationStop(), Train(), and Type().