MVFirefly Class Reference

#include <MVFirefly.h>

Inheritance diagram for MVFirefly:

MVMovingOnPlaceObject MVOnPlaceObject MVPlaceObject Object

List of all members.

Public Member Functions

 MVFirefly ()
 MVFirefly (MVBoard *board, Uint32 x, Uint32 y)
 Default constructor.
 ~MVFirefly ()
 Destructor.
void addToPocket (MVMaterial *object)
 Adds an OnPlaceObject to the firefly's pocket.
void removeFromPocket (MVMaterial *object)
 Removes an OnPlaceObject from the firefly's pocket.
std::vector< MVMaterial * > * getPocket ()
 Returns a pointer to the list of objects in the firefly's pocket.
Vector move (const Vector &movement, Uint32 timeDif)
 Moves the firefly with collision detection.
void setX (int x)
 Set new value for x-position. (should only be called by MVBoard).
void setY (int y)
 Set new value for y-position. (should only be called by MVBoard).
void setWater (GLfloat water)
 Setter for water.
GLfloat getWater ()
 Gettter for water.
void setFood (GLfloat food)
 Setter for food.
GLfloat getFood ()
 Gettter for food.
void setScore (Uint32 score)
 Setter for score.
void setMaxScore (Uint32 maxScore)
 Setter for maxScore.
Uint32 getScore ()
 Getter for score.
Uint32 getMaxScore ()
 Getter for maxScore.
Vector getRealWorldCoordinates ()
 Vector for camera alignment.
void renderGl ()
 Do the drawing stuff.
virtual string toString () const
 Returns a textual representation.
virtual string className () const
 Returns the class name of the object.
virtual enum classId classId () const
 Returns the class id of the object.

Private Attributes

std::vector< MVMaterial * > pocket
 Vector of things in the firefly's pocket.
ParticleSystem glow
 Aura around firefly.
GLfloat water
 Indicates strength of the firefly.
GLfloat food
 Indicates strength of the firefly.
bool live
 Tells us if Firefly is dead.
Uint32 score
 Value firefly has collected so far.
Uint32 maxScore
 Value firefly must achieve to win.
MVBoardboard
 Firefly's world.
Uint32 xStartBoard
 Firefly's surroundings x-start.
Uint32 xEndBoard
 Firefly's surroundings x-start.
Uint32 yStartBoard
 Firefly's surroundings x-start.
Uint32 yEndBoard
 Firefly's surroundings x-start.
Uint32 xOriginal
 Where was the firefly spawned? x-coord.
Uint32 yOriginal
 Where was the firefly spawned? y-coord.


Constructor & Destructor Documentation

MVFirefly::MVFirefly (  ) 

MVFirefly::MVFirefly ( MVBoard board,
Uint32  x,
Uint32  y 
)

Default constructor.

Default constructor.

MVFirefly::~MVFirefly (  ) 

Destructor.


Member Function Documentation

void MVFirefly::addToPocket ( MVMaterial object  ) 

Adds an OnPlaceObject to the firefly's pocket.

Adds an OnPlaceObject to the firefly's pocket.

Parameters:
object Pointer to the object, instance of MVOnPlaceObject, which should be added.

void MVFirefly::removeFromPocket ( MVMaterial object  ) 

Removes an OnPlaceObject from the firefly's pocket.

Removes an OnPlaceObject from the firefly's pocket.

Parameters:
object Pointer to the object, instance of MVOnPlaceObject, which should be removed.

std::vector< MVMaterial * > * MVFirefly::getPocket (  ) 

Returns a pointer to the list of objects in the firefly's pocket.

Returns:
a pointer to the list of objects in the firefly's pocket.

Vector MVFirefly::move ( const Vector movement,
Uint32  timeDif 
)

Moves the firefly with collision detection.

Very primitive and ineffective collision detection

Parameters:
movement Where you would like to go
Returns:
Where you can go

void MVFirefly::setX ( int  x  ) 

Set new value for x-position. (should only be called by MVBoard).

Reimplemented from MVPlaceObject.

void MVFirefly::setY ( int  y  ) 

Set new value for y-position. (should only be called by MVBoard).

Reimplemented from MVPlaceObject.

void MVFirefly::setWater ( GLfloat  water  ) 

Setter for water.

Parameters:
water the new water reserves for Firefly

GLfloat MVFirefly::getWater (  ) 

Gettter for water.

Returns:
the water reserves of Firefly

void MVFirefly::setFood ( GLfloat  food  ) 

Setter for food.

Parameters:
water the new food reserves for Firefly

GLfloat MVFirefly::getFood (  ) 

Gettter for food.

Returns:
the food reserves of Firefly

void MVFirefly::setScore ( Uint32  score  ) 

Setter for score.

Parameters:
score the new score

void MVFirefly::setMaxScore ( Uint32  maxScore  ) 

Setter for maxScore.

Parameters:
maxScore the new max score

Uint32 MVFirefly::getScore (  ) 

Getter for score.

Returns:
the current score

Uint32 MVFirefly::getMaxScore (  ) 

Getter for maxScore.

Returns:
the current max score

Vector MVFirefly::getRealWorldCoordinates (  ) 

Vector for camera alignment.

void MVFirefly::renderGl (  )  [virtual]

Do the drawing stuff.

Do the drawing stuff.

Reimplemented from MVPlaceObject.

string MVFirefly::toString (  )  const [virtual]

Returns a textual representation.

Returns:
a string descriping the run-time object

Reimplemented from MVMovingOnPlaceObject.

string MVFirefly::className (  )  const [virtual]

Returns the class name of the object.

Returns:
a string with the name of the object's class

Reimplemented from MVMovingOnPlaceObject.

enum classId MVFirefly::classId (  )  const [virtual]

Returns the class id of the object.

Returns:
an id of the object's class

Reimplemented from MVMovingOnPlaceObject.


Member Data Documentation

std::vector<MVMaterial*> MVFirefly::pocket [private]

Vector of things in the firefly's pocket.

Aura around firefly.

GLfloat MVFirefly::water [private]

Indicates strength of the firefly.

GLfloat MVFirefly::food [private]

Indicates strength of the firefly.

bool MVFirefly::live [private]

Tells us if Firefly is dead.

Uint32 MVFirefly::score [private]

Value firefly has collected so far.

Uint32 MVFirefly::maxScore [private]

Value firefly must achieve to win.

Firefly's world.

Uint32 MVFirefly::xStartBoard [private]

Firefly's surroundings x-start.

Uint32 MVFirefly::xEndBoard [private]

Firefly's surroundings x-start.

Uint32 MVFirefly::yStartBoard [private]

Firefly's surroundings x-start.

Uint32 MVFirefly::yEndBoard [private]

Firefly's surroundings x-start.

Uint32 MVFirefly::xOriginal [private]

Where was the firefly spawned? x-coord.

Uint32 MVFirefly::yOriginal [private]

Where was the firefly spawned? y-coord.


The documentation for this class was generated from the following files:

Generated on Mon Jul 7 13:30:34 2008 for Firefly by  doxygen 1.5.6