Model Railroad System  2.2.2
Public Member Functions | Private Attributes | Friends | List of all members
FCFSupport::Car Class Reference

This class holds all of the information for a single car. More...

#include <Car.h>

Public Member Functions

 Car ()
 Default constructor. More...
 
 Car (Car &other)
 Copy constructor. More...
 
Caroperator= (Car &other)
 Assignment operator. More...
 
 Car (char t, const char *m, const char *n, const char *d, int l, int p, int wc, int lw, int ldw, bool lp, bool mp, bool fp, const Owner *own, bool dp, const Train *lt, int mvs, Industry *loc, Industry *dest, int trps, int asgns)
 Full constructor. More...
 
char Type () const
 Return the car type. More...
 
void SetType (char t)
 Set the car type. More...
 
const char * Marks () const
 Return the car's reporting marks (railroad). More...
 
void SetMarks (string m)
 Set the car's reporting marks. More...
 
const char * Number () const
 Return the car's number. More...
 
void SetNumber (string n)
 Set the car's number. More...
 
const char * Divisions () const
 Return the car's division list. More...
 
void SetDivisions (string d)
 Set the car's division list. More...
 
int Length () const
 Return the car's length. More...
 
void SetLength (int l)
 Set the car's length. More...
 
int Plate () const
 Return the car's clearence plate. More...
 
void SetPlate (int p)
 Set the car's clearence plate. More...
 
int WeightClass () const
 Return the car's weight class. More...
 
void SetWeightClass (int wc)
 Set the car's weight class. More...
 
int LtWt () const
 Return the car's empty weight. More...
 
void SetLtWt (int lw)
 Set the car's empty weight. More...
 
int LdLmt () const
 Return the car's load limit. More...
 
void SetLdLmt (int ldw)
 Set the car's load limit. More...
 
bool LoadedP () const
 Is the car loaded? More...
 
bool EmptyP () const
 Is the car empty? More...
 
void Load ()
 Load the car. More...
 
void UnLoad ()
 Unload the car. More...
 
bool OkToMirrorP () const
 Is it OK to mirror this car? More...
 
void SetOkToMirrorP (bool m)
 Set this car's mirror status. More...
 
bool FixedRouteP () const
 Is this car on a fixed route? More...
 
void SetFixedRouteP (bool f)
 Set whether this car is on a fixed route. More...
 
const OwnerCarOwner () const
 Return the car's owner. More...
 
void SetCarOwner (const Owner *o)
 Set the car's owner. More...
 
bool IsDoneP () const
 Is this car done? More...
 
void SetDone ()
 Flag this car as done. More...
 
void SetNotDone ()
 Flag this car as not done. More...
 
const TrainLastTrain () const
 Return the last train to move this car. More...
 
void SetLastTrain (const Train *lt)
 Set the last train to move this car. More...
 
const TrainPrevTrain () const
 Return the previous train to move this car. More...
 
void SetPrevTrain (const Train *lt)
 Set the previous train to move this car. More...
 
int MovementsThisSession () const
 Return the number of movements this session. More...
 
void ClearMovementsThisSession ()
 Clear the number of movements this session. More...
 
void IncrmentMovementsThisSession ()
 Increment the number of movements this session. More...
 
IndustryLocation () const
 Return the location of this car. More...
 
void SetLocation (Industry *newloc)
 Set the location of this car. More...
 
IndustryDestination () const
 Return the destination of this car. More...
 
void SetDestination (Industry *newdest)
 Set the destination of this car. More...
 
int Trips () const
 Return the number of trips this car has had. More...
 
void ClearTrips ()
 Clear the number of trips this car has had. More...
 
void IncrementTrips ()
 Increment the number of trips this car has had. More...
 
int Assignments () const
 Return the number of assignments this car has had. More...
 
void SetAssignments (int a)
 Set the number of assignments this car has had. More...
 
void ClearAssignments ()
 Clear the number of assignments this car has had. More...
 
void IncrementAssignments ()
 Increment the number of assignments this car has had. More...
 
bool Peek () const
 Return the peek flag. More...
 
void SetPeek (bool p=false)
 Set or clear the peek flag. More...
 

Private Attributes

const Ownerowner
 The owner of this car. More...
 
const Trainlasttrain
 The last train to handle this car. More...
 
const Trainprevtrain
 The previous train to handle this car. More...
 
Industrylocation
 This car's location. More...
 
Industrydestination
 This car's destination. More...
 
string marks
 This car's reporting marks. More...
 
string number
 This car's number. More...
 
string divisions
 This car's division list. More...
 
int length
 This car's length. More...
 
int plate
 This car's clearance plate. More...
 
int weightclass
 This car's weight class. More...
 
int ltwt
 This car's empty weight. More...
 
int ldlmt
 This car's loaded weight. More...
 
int trips
 The number of trips this car has made. More...
 
int moves
 The number of moves this car has made. More...
 
int assignments
 The number of assignments this car has had. More...
 
bool loadedP
 This car's loaded flag. More...
 
bool mirrorP
 This car's mirror flag. More...
 
bool fixedP
 This car's fixed route flag. More...
 
bool doneP
 This car's done flag. More...
 
bool peek
 This car's peel flak. More...
 
bool tmpStatus
 Temp status flag. More...
 
char type
 This car's type. More...
 

Friends

class System
 The System class is a friend. More...
 

Detailed Description

This class holds all of the information for a single car.

Including its reporting marks, car number, type, division list, owner, length, weight, and so on.

@author Robert Heller \<heller\@deepsoft.com\>

Constructor & Destructor Documentation

◆ Car() [1/3]

FCFSupport::Car::Car ( )
inline

Default constructor.

All slots are initialized to default values.

References assignments, destination, divisions, doneP, fixedP, lasttrain, ldlmt, length, loadedP, location, ltwt, marks, mirrorP, moves, number, owner, peek, plate, prevtrain, tmpStatus, trips, type, and weightclass.

◆ Car() [2/3]

FCFSupport::Car::Car ( Car other)
inline

Copy constructor.

All slots are copied.

Parameters
otherThe originating instance.

References assignments, destination, divisions, doneP, fixedP, lasttrain, ldlmt, length, loadedP, location, ltwt, marks, mirrorP, moves, number, owner, peek, plate, prevtrain, tmpStatus, trips, type, and weightclass.

◆ Car() [3/3]

FCFSupport::Car::Car ( char  t,
const char *  m,
const char *  n,
const char *  d,
int  l,
int  p,
int  wc,
int  lw,
int  ldw,
bool  lp,
bool  mp,
bool  fp,
const Owner own,
bool  dp,
const Train lt,
int  mvs,
Industry loc,
Industry dest,
int  trps,
int  asgns 
)
inline

Full constructor.

Fill all slots from the argument list.

Parameters
tCar type.
mReporting marks (railroad).
nNumber.
dDivision symbol list.
lLength.
pPlate.
wcWeight class.
lwLight (empty) weight.
ldwLoad limit (loaded weight).
lpIs the car loaded?
mpCan the car be mirrored?
fpDoes it have a fixed route?
ownCar owner.
dpIs it done moving?
ltThe last train to handle this car.
mvsThe number of times this car has been moved this session.
locThe car's current location.
destThe car's destination.
trpsThe number of trips this car has made.
asgnsThe number of times this car has been assigned.

References assignments, destination, divisions, doneP, fixedP, lasttrain, ldlmt, length, loadedP, location, ltwt, marks, mirrorP, moves, number, owner, plate, prevtrain, trips, type, and weightclass.

Member Function Documentation

◆ Assignments()

int FCFSupport::Car::Assignments ( ) const
inline

Return the number of assignments this car has had.

References assignments.

◆ CarOwner()

const Owner* FCFSupport::Car::CarOwner ( ) const
inline

Return the car's owner.

References owner.

◆ ClearAssignments()

void FCFSupport::Car::ClearAssignments ( )
inline

Clear the number of assignments this car has had.

References assignments.

◆ ClearMovementsThisSession()

void FCFSupport::Car::ClearMovementsThisSession ( )
inline

Clear the number of movements this session.

References moves.

◆ ClearTrips()

void FCFSupport::Car::ClearTrips ( )
inline

Clear the number of trips this car has had.

References trips.

◆ Destination()

Industry* FCFSupport::Car::Destination ( ) const
inline

Return the destination of this car.

References destination.

◆ Divisions()

const char* FCFSupport::Car::Divisions ( ) const
inline

Return the car's division list.

References divisions.

◆ EmptyP()

bool FCFSupport::Car::EmptyP ( ) const
inline

Is the car empty?

References loadedP.

◆ FixedRouteP()

bool FCFSupport::Car::FixedRouteP ( ) const
inline

Is this car on a fixed route?

References fixedP.

◆ IncrementAssignments()

void FCFSupport::Car::IncrementAssignments ( )
inline

Increment the number of assignments this car has had.

References assignments.

◆ IncrementTrips()

void FCFSupport::Car::IncrementTrips ( )
inline

Increment the number of trips this car has had.

References trips.

◆ IncrmentMovementsThisSession()

void FCFSupport::Car::IncrmentMovementsThisSession ( )
inline

Increment the number of movements this session.

References moves.

◆ IsDoneP()

bool FCFSupport::Car::IsDoneP ( ) const
inline

Is this car done?

References doneP.

◆ LastTrain()

const Train* FCFSupport::Car::LastTrain ( ) const
inline

Return the last train to move this car.

References lasttrain.

◆ LdLmt()

int FCFSupport::Car::LdLmt ( ) const
inline

Return the car's load limit.

References ldlmt.

◆ Length()

int FCFSupport::Car::Length ( ) const
inline

Return the car's length.

References length.

◆ Load()

void FCFSupport::Car::Load ( )
inline

Load the car.

References loadedP.

◆ LoadedP()

bool FCFSupport::Car::LoadedP ( ) const
inline

Is the car loaded?

References loadedP.

◆ Location()

Industry* FCFSupport::Car::Location ( ) const
inline

Return the location of this car.

References location.

◆ LtWt()

int FCFSupport::Car::LtWt ( ) const
inline

Return the car's empty weight.

References ltwt.

◆ Marks()

const char* FCFSupport::Car::Marks ( ) const
inline

Return the car's reporting marks (railroad).

References marks.

◆ MovementsThisSession()

int FCFSupport::Car::MovementsThisSession ( ) const
inline

Return the number of movements this session.

References moves.

◆ Number()

const char* FCFSupport::Car::Number ( ) const
inline

Return the car's number.

References number.

◆ OkToMirrorP()

bool FCFSupport::Car::OkToMirrorP ( ) const
inline

Is it OK to mirror this car?

References mirrorP.

◆ operator=()

Car& FCFSupport::Car::operator= ( Car other)
inline

Assignment operator.

All slots are copied.

Parameters
otherThe right hand operand.

References assignments, destination, divisions, doneP, fixedP, lasttrain, ldlmt, length, loadedP, location, ltwt, marks, mirrorP, moves, number, owner, peek, plate, prevtrain, tmpStatus, trips, type, and weightclass.

◆ Peek()

bool FCFSupport::Car::Peek ( ) const
inline

Return the peek flag.

References peek.

◆ Plate()

int FCFSupport::Car::Plate ( ) const
inline

Return the car's clearence plate.

References plate.

◆ PrevTrain()

const Train* FCFSupport::Car::PrevTrain ( ) const
inline

Return the previous train to move this car.

References prevtrain.

◆ SetAssignments()

void FCFSupport::Car::SetAssignments ( int  a)
inline

Set the number of assignments this car has had.

References assignments.

◆ SetCarOwner()

void FCFSupport::Car::SetCarOwner ( const Owner o)
inline

Set the car's owner.

References owner.

◆ SetDestination()

void FCFSupport::Car::SetDestination ( Industry newdest)
inline

Set the destination of this car.

References destination.

◆ SetDivisions()

void FCFSupport::Car::SetDivisions ( string  d)
inline

Set the car's division list.

References divisions.

◆ SetDone()

void FCFSupport::Car::SetDone ( )
inline

Flag this car as done.

References doneP.

◆ SetFixedRouteP()

void FCFSupport::Car::SetFixedRouteP ( bool  f)
inline

Set whether this car is on a fixed route.

References fixedP.

◆ SetLastTrain()

void FCFSupport::Car::SetLastTrain ( const Train lt)
inline

Set the last train to move this car.

References lasttrain.

◆ SetLdLmt()

void FCFSupport::Car::SetLdLmt ( int  ldw)
inline

Set the car's load limit.

References ldlmt.

◆ SetLength()

void FCFSupport::Car::SetLength ( int  l)
inline

Set the car's length.

References length.

◆ SetLocation()

void FCFSupport::Car::SetLocation ( Industry newloc)
inline

Set the location of this car.

References location.

◆ SetLtWt()

void FCFSupport::Car::SetLtWt ( int  lw)
inline

Set the car's empty weight.

References ltwt.

◆ SetMarks()

void FCFSupport::Car::SetMarks ( string  m)
inline

Set the car's reporting marks.

References marks.

◆ SetNotDone()

void FCFSupport::Car::SetNotDone ( )
inline

Flag this car as not done.

References doneP.

◆ SetNumber()

void FCFSupport::Car::SetNumber ( string  n)
inline

Set the car's number.

References number.

◆ SetOkToMirrorP()

void FCFSupport::Car::SetOkToMirrorP ( bool  m)
inline

Set this car's mirror status.

References mirrorP.

◆ SetPeek()

void FCFSupport::Car::SetPeek ( bool  p = false)
inline

Set or clear the peek flag.

References peek.

◆ SetPlate()

void FCFSupport::Car::SetPlate ( int  p)
inline

Set the car's clearence plate.

References plate.

◆ SetPrevTrain()

void FCFSupport::Car::SetPrevTrain ( const Train lt)
inline

Set the previous train to move this car.

References prevtrain.

◆ SetType()

void FCFSupport::Car::SetType ( char  t)
inline

Set the car type.

Parameters
tThe new car type.

References type.

◆ SetWeightClass()

void FCFSupport::Car::SetWeightClass ( int  wc)
inline

Set the car's weight class.

References weightclass.

◆ Trips()

int FCFSupport::Car::Trips ( ) const
inline

Return the number of trips this car has had.

References trips.

◆ Type()

char FCFSupport::Car::Type ( ) const
inline

Return the car type.

References type.

◆ UnLoad()

void FCFSupport::Car::UnLoad ( )
inline

Unload the car.

References loadedP.

◆ WeightClass()

int FCFSupport::Car::WeightClass ( ) const
inline

Return the car's weight class.

References weightclass.

Friends And Related Function Documentation

◆ System

friend class System
friend

The System class is a friend.

Member Data Documentation

◆ assignments

int FCFSupport::Car::assignments
private

The number of assignments this car has had.

Referenced by Assignments(), Car(), ClearAssignments(), IncrementAssignments(), operator=(), and SetAssignments().

◆ destination

Industry* FCFSupport::Car::destination
private

This car's destination.

Referenced by Car(), Destination(), operator=(), and SetDestination().

◆ divisions

string FCFSupport::Car::divisions
private

This car's division list.

Referenced by Car(), Divisions(), operator=(), and SetDivisions().

◆ doneP

bool FCFSupport::Car::doneP
private

This car's done flag.

Referenced by Car(), IsDoneP(), operator=(), SetDone(), and SetNotDone().

◆ fixedP

bool FCFSupport::Car::fixedP
private

This car's fixed route flag.

Referenced by Car(), FixedRouteP(), operator=(), and SetFixedRouteP().

◆ lasttrain

const Train* FCFSupport::Car::lasttrain
private

The last train to handle this car.

Referenced by Car(), LastTrain(), operator=(), and SetLastTrain().

◆ ldlmt

int FCFSupport::Car::ldlmt
private

This car's loaded weight.

Referenced by Car(), LdLmt(), operator=(), and SetLdLmt().

◆ length

int FCFSupport::Car::length
private

This car's length.

Referenced by Car(), Length(), operator=(), and SetLength().

◆ loadedP

bool FCFSupport::Car::loadedP
private

This car's loaded flag.

Referenced by Car(), EmptyP(), Load(), LoadedP(), operator=(), and UnLoad().

◆ location

Industry* FCFSupport::Car::location
private

This car's location.

Referenced by Car(), Location(), operator=(), and SetLocation().

◆ ltwt

int FCFSupport::Car::ltwt
private

This car's empty weight.

Referenced by Car(), LtWt(), operator=(), and SetLtWt().

◆ marks

string FCFSupport::Car::marks
private

This car's reporting marks.

Referenced by Car(), Marks(), operator=(), and SetMarks().

◆ mirrorP

bool FCFSupport::Car::mirrorP
private

This car's mirror flag.

Referenced by Car(), OkToMirrorP(), operator=(), and SetOkToMirrorP().

◆ moves

int FCFSupport::Car::moves
private

The number of moves this car has made.

Referenced by Car(), ClearMovementsThisSession(), IncrmentMovementsThisSession(), MovementsThisSession(), and operator=().

◆ number

string FCFSupport::Car::number
private

This car's number.

Referenced by Car(), Number(), operator=(), and SetNumber().

◆ owner

const Owner* FCFSupport::Car::owner
private

The owner of this car.

Referenced by Car(), CarOwner(), operator=(), and SetCarOwner().

◆ peek

bool FCFSupport::Car::peek
private

This car's peel flak.

Referenced by Car(), operator=(), Peek(), and SetPeek().

◆ plate

int FCFSupport::Car::plate
private

This car's clearance plate.

Referenced by Car(), operator=(), Plate(), and SetPlate().

◆ prevtrain

const Train* FCFSupport::Car::prevtrain
private

The previous train to handle this car.

Referenced by Car(), operator=(), PrevTrain(), and SetPrevTrain().

◆ tmpStatus

bool FCFSupport::Car::tmpStatus
private

Temp status flag.

Referenced by Car(), and operator=().

◆ trips

int FCFSupport::Car::trips
private

The number of trips this car has made.

Referenced by Car(), ClearTrips(), IncrementTrips(), operator=(), and Trips().

◆ type

char FCFSupport::Car::type
private

This car's type.

Referenced by Car(), operator=(), SetType(), and Type().

◆ weightclass

int FCFSupport::Car::weightclass
private

This car's weight class.

Referenced by Car(), operator=(), SetWeightClass(), and WeightClass().