Main Page   Class Hierarchy   Compound List   File List   Compound Members  

PlayerBase Class Reference

Base class for the players in the game. More...

#include <playerbase.h>

Inheritance diagram for PlayerBase:

Inheritance graph
[legend]
List of all members.

Public Methods

 PlayerBase (unsigned id, string nm, char race, char color, int x=0, int y=0)
 PlayerBase (const PlayerBase &p)
 PlayerBase ()
virtual ~PlayerBase ()
PlayerBase & operator= (const PlayerBase &p)
unsigned getIndex () const
char getRace () const
char getColor () const
int getPosX () const
int getPosY () const
int getTileX () const
int getTileY () const
int getResource (Resource r) const
int getVelocity () const
int getBaseVelocity () const
int getDirX () const
int getDirY () const
bool isMoving () const
bool isAlive () const
unsigned getCardinalDirection () const
const string & getName () const
virtual string getProperties () const
 Returns a string containing all the information about the player.

void setIndex (unsigned i)
void setAlive (bool lives)
void setRace (char c)
void setColor (char c)
void setPosX (int x)
void setPosY (int y)
void setPos (int x, int y)
void setDirX (int x)
void setDirY (int y)
void setResource (Resource r, int a)
void setName (const string &n)
void stop ()
void setCardinalDirection (unsigned direction)
void setVelocity (int v)
virtual void setProperties (const string &properties)
 Updates the player's properties. More...

void print () const
 Prints the player information. More...


Protected Attributes

int index
string name
char race
char color
int posx
int posy
int dirx
int diry
int baseVelocity
int velocity
int resources [NUMRESOURCES]
bool alive

Detailed Description

Base class for the players in the game.

Base class for all the kinds of player in the game, both in the server and the client


Member Function Documentation

void PlayerBase::print   const
 

Prints the player information.

Useful for debugging issues.

void PlayerBase::setProperties const string &    properties [virtual]
 

Updates the player's properties.

Takes a string containing a specification of a player's properties, and updates itself with them.

Parameters:
properties  contains the description of the new features for the player.


The documentation for this class was generated from the following files:
Generated on Thu Jun 6 17:22:23 2002 for Perihelion by doxygen1.2.15