Main Page | Class List | Directories | File List | Class Members | File Members

Train Class Reference

Represents a train. More...

#include <train.h>

List of all members.

Public Member Functions

void draw ()
 Draws the train.
bool loadFromFile (char *filename)
 Loads a train from a file.
bool initialize (Bridge &bridge)
 Creates the train and checks if an end-to-end road can be found.
bool doPhysics (component timestep)
 Simulates the train.
void finalize ()
 Stops the train simulation.
void cleanUp ()
 Cleans up after train simulation.

Public Attributes

vector< coachcoaches
 The coaches.
component trainLength
 The length of the train.
vector< vertexcoachVertices
 The vertices representing the train.
vector< edgecoachEdges
 The edges representing the train.
int textureWidth
 The dimensions of the texture image.
int textureHeight
 The dimensions of the texture image.
unsigned char * image
 The texture image.
bool hasSmoke
 True iff this train has smoke.
Smoke smoke
 The smoke particle system.
vector2 smokeSource
 The source position of the smoke.


Detailed Description

Represents a train.


Member Function Documentation

bool Train::doPhysics component  timestep  ) 
 

Simulates the train.

Parameters:
timestep the time step
Returns:
true iff the train has successfully passed the bridge

bool Train::initialize Bridge bridge  ) 
 

Creates the train and checks if an end-to-end road can be found.

Should be called before doTrain(component).

Returns:
true iff a road can be found

bool Train::loadFromFile char *  filename  ) 
 

Loads a train from a file.

Returns:
true iff loading is successful


The documentation for this class was generated from the following files:
Generated on Sun Jul 10 22:32:04 2005 for S12 by  doxygen 1.4.2