Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

Transport Class Reference

Transport resource class. More...

#include <TraplasObject.h>

Inheritance diagram for Transport:

Inheritance graph
[legend]
Collaboration diagram for Transport:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Transport (int transport_id, int type_transport, double spd, osg::Node *trans_model)
double getSpeed ()
bool setSpeed (double s_spd)
string getDestination ()
bool setDestination (string s_dest)
int getCargo ()
bool setCargo (int s_carg, string desc)
int clearCargo ()
string toString ()

Protected Attributes

double speed
string c_desc
int carg
string destination

Detailed Description

Transport resource class.

Definition at line 169 of file TraplasObject.h.


Constructor & Destructor Documentation

Transport::Transport int  transport_id,
int  type_transport,
double  spd,
osg::Node *  trans_model
 

Constructor

Parameters:
transport_id The id of the Transport Resource.
type_transport The type identifier of this object.
spd The speed of the Transport Resource.
trans_model The model used for this Transport Resource.

Definition at line 176 of file TraplasObject.cpp.

References c_desc, carg, destination, TraplasObject::id, TraplasObject::model, TraplasObject::selected, TraplasObject::setDescription(), speed, and TraplasObject::type.

Here is the call graph for this function:


Member Function Documentation

int Transport::clearCargo  ) 
 

Removes the cargo from this transport.

Returns:
The id of the cargo removed.

Definition at line 209 of file TraplasObject.cpp.

References c_desc, and carg.

Referenced by StateControl::unload().

int Transport::getCargo  )  [inline]
 

Returns:
The identifier of the cargo object being transported by this transport resource, or -1 if there isn't any.

Definition at line 203 of file TraplasObject.h.

References carg.

Referenced by StateControl::trdel(), and StateControl::unload().

string Transport::getDestination  )  [inline]
 

Returns:
The final destination of the current planning of this transport resource.

Definition at line 193 of file TraplasObject.h.

References destination.

double Transport::getSpeed  )  [inline]
 

Returns:
The speed of the transport resource.

Definition at line 183 of file TraplasObject.h.

References speed.

bool Transport::setCargo int  s_carg,
string  desc
 

Sets the cargo of this transport resource.

Parameters:
s_carg The identifier of the cargo to be loaded.
desc The description of the cargo (to be printed on the screen).
Returns:
true if succesfull, false if there has been an error.

Definition at line 202 of file TraplasObject.cpp.

References c_desc, and carg.

Referenced by StateControl::load().

bool Transport::setDestination string  s_dest  ) 
 

Sets the destination of a transport resource.

Parameters:
s_dest The description of the infrastructure resource that is the new destination.
Returns:
true if succesfull, false if there has been an error.

Definition at line 197 of file TraplasObject.cpp.

References destination.

Referenced by StateControl::drv().

bool Transport::setSpeed double  s_spd  ) 
 

Sets the speed of the transport resource.

Parameters:
s_spd The new speed for the transport resource.
Returns:
true if succesfull, false if there has been an error.

Definition at line 192 of file TraplasObject.cpp.

References speed.

Referenced by StateControl::setspdinviz().

string Transport::toString  )  [virtual]
 

Returns:
A string with information about this TraplasObject.

Reimplemented from TraplasObject.

Definition at line 216 of file TraplasObject.cpp.

References c_desc, carg, TraplasObject::description, destination, and speed.


Member Data Documentation

string Transport::c_desc [protected]
 

Definition at line 222 of file TraplasObject.h.

Referenced by clearCargo(), setCargo(), toString(), and Transport().

int Transport::carg [protected]
 

Definition at line 223 of file TraplasObject.h.

Referenced by clearCargo(), getCargo(), setCargo(), toString(), and Transport().

string Transport::destination [protected]
 

Definition at line 224 of file TraplasObject.h.

Referenced by getDestination(), setDestination(), toString(), and Transport().

double Transport::speed [protected]
 

Definition at line 221 of file TraplasObject.h.

Referenced by getSpeed(), setSpeed(), toString(), and Transport().


The documentation for this class was generated from the following files:
Generated on Mon Jun 19 10:22:23 2006 for TraplasVisualisation by  doxygen 1.4.4