|
Model Railroad System 2.2.2
|
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... | |
| Car & | operator= (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 Owner * | CarOwner () 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 Train * | LastTrain () 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 Train * | PrevTrain () 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... | |
| Industry * | Location () const |
| Return the location of this car. More... | |
| void | SetLocation (Industry *newloc) |
| Set the location of this car. More... | |
| Industry * | Destination () 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 Owner * | owner |
| The owner of this car. More... | |
| const Train * | lasttrain |
| The last train to handle this car. More... | |
| const Train * | prevtrain |
| The previous train to handle this car. More... | |
| Industry * | location |
| This car's location. More... | |
| Industry * | destination |
| 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... | |
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\>
|
inline |
|
inline |
|
inline |
Full constructor.
Fill all slots from the argument list.
| t | Car type. |
| m | Reporting marks (railroad). |
| n | Number. |
| d | Division symbol list. |
| l | Length. |
| p | Plate. |
| wc | Weight class. |
| lw | Light (empty) weight. |
| ldw | Load limit (loaded weight). |
| lp | Is the car loaded? |
| mp | Can the car be mirrored? |
| fp | Does it have a fixed route? |
| own | Car owner. |
| dp | Is it done moving? |
| lt | The last train to handle this car. |
| mvs | The number of times this car has been moved this session. |
| loc | The car's current location. |
| dest | The car's destination. |
| trps | The number of trips this car has made. |
| asgns | The 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.
|
inline |
Return the number of assignments this car has had.
References assignments.
|
inline |
Clear the number of assignments this car has had.
References assignments.
|
inline |
Clear the number of movements this session.
References moves.
|
inline |
Clear the number of trips this car has had.
References trips.
|
inline |
Return the destination of this car.
References destination.
|
inline |
Return the car's division list.
References divisions.
|
inline |
Is the car empty?
References loadedP.
|
inline |
Is this car on a fixed route?
References fixedP.
|
inline |
Increment the number of assignments this car has had.
References assignments.
|
inline |
Increment the number of trips this car has had.
References trips.
|
inline |
Increment the number of movements this session.
References moves.
|
inline |
Is this car done?
References doneP.
|
inline |
Return the last train to move this car.
References lasttrain.
|
inline |
Return the car's load limit.
References ldlmt.
|
inline |
Return the car's length.
References length.
|
inline |
Load the car.
References loadedP.
|
inline |
Is the car loaded?
References loadedP.
|
inline |
Return the location of this car.
References location.
|
inline |
Return the car's empty weight.
References ltwt.
|
inline |
Return the car's reporting marks (railroad).
References marks.
|
inline |
Return the number of movements this session.
References moves.
|
inline |
Return the car's number.
References number.
|
inline |
Is it OK to mirror this car?
References mirrorP.
|
inline |
Return the peek flag.
References peek.
|
inline |
Return the car's clearence plate.
References plate.
|
inline |
Return the previous train to move this car.
References prevtrain.
|
inline |
Set the number of assignments this car has had.
References assignments.
|
inline |
Set the destination of this car.
References destination.
|
inline |
Set the car's division list.
References divisions.
|
inline |
Flag this car as done.
References doneP.
|
inline |
Set whether this car is on a fixed route.
References fixedP.
|
inline |
Set the last train to move this car.
References lasttrain.
|
inline |
Set the car's load limit.
References ldlmt.
|
inline |
Set the car's length.
References length.
|
inline |
Set the location of this car.
References location.
|
inline |
Set the car's empty weight.
References ltwt.
|
inline |
Set the car's reporting marks.
References marks.
|
inline |
Flag this car as not done.
References doneP.
|
inline |
Set the car's number.
References number.
|
inline |
Set this car's mirror status.
References mirrorP.
|
inline |
Set or clear the peek flag.
References peek.
|
inline |
Set the car's clearence plate.
References plate.
|
inline |
Set the previous train to move this car.
References prevtrain.
|
inline |
|
inline |
Set the car's weight class.
References weightclass.
|
inline |
Return the number of trips this car has had.
References trips.
|
inline |
Return the car type.
References type.
|
inline |
Unload the car.
References loadedP.
|
inline |
Return the car's weight class.
References weightclass.
|
private |
The number of assignments this car has had.
Referenced by Assignments(), Car(), ClearAssignments(), IncrementAssignments(), operator=(), and SetAssignments().
|
private |
This car's destination.
Referenced by Car(), Destination(), operator=(), and SetDestination().
|
private |
This car's division list.
Referenced by Car(), Divisions(), operator=(), and SetDivisions().
|
private |
This car's done flag.
Referenced by Car(), IsDoneP(), operator=(), SetDone(), and SetNotDone().
|
private |
This car's fixed route flag.
Referenced by Car(), FixedRouteP(), operator=(), and SetFixedRouteP().
|
private |
The last train to handle this car.
Referenced by Car(), LastTrain(), operator=(), and SetLastTrain().
|
private |
This car's loaded weight.
Referenced by Car(), LdLmt(), operator=(), and SetLdLmt().
|
private |
This car's length.
Referenced by Car(), Length(), operator=(), and SetLength().
|
private |
|
private |
This car's location.
Referenced by Car(), Location(), operator=(), and SetLocation().
|
private |
This car's empty weight.
Referenced by Car(), LtWt(), operator=(), and SetLtWt().
|
private |
This car's reporting marks.
Referenced by Car(), Marks(), operator=(), and SetMarks().
|
private |
This car's mirror flag.
Referenced by Car(), OkToMirrorP(), operator=(), and SetOkToMirrorP().
|
private |
The number of moves this car has made.
Referenced by Car(), ClearMovementsThisSession(), IncrmentMovementsThisSession(), MovementsThisSession(), and operator=().
|
private |
This car's number.
Referenced by Car(), Number(), operator=(), and SetNumber().
|
private |
The owner of this car.
Referenced by Car(), CarOwner(), operator=(), and SetCarOwner().
|
private |
This car's peel flak.
Referenced by Car(), operator=(), Peek(), and SetPeek().
|
private |
This car's clearance plate.
Referenced by Car(), operator=(), Plate(), and SetPlate().
|
private |
The previous train to handle this car.
Referenced by Car(), operator=(), PrevTrain(), and SetPrevTrain().
|
private |
Temp status flag.
Referenced by Car(), and operator=().
|
private |
The number of trips this car has made.
Referenced by Car(), ClearTrips(), IncrementTrips(), operator=(), and Trips().
|
private |
This car's type.
Referenced by Car(), operator=(), SetType(), and Type().
|
private |
This car's weight class.
Referenced by Car(), operator=(), SetWeightClass(), and WeightClass().