CharacterData Class Reference

#include <characterdata.hpp>

Inheritance diagram for CharacterData:

AbstractCharacterData List of all members.

Public Member Functions

 CharacterData (std::string const &name, int id=-1)
 CharacterData (MessageIn &msg)
 Constructor used for creating a character from a serialised message.
int getDatabaseID () const
 Gets the database id of the character.
void setDatabaseID (int id)
 Sets the database id of the character.
int getAccountID () const
 Gets the account id of the account the character belongs to.
void setAccountID (int id)
 Sets the account id of the account the character belongs to.
std::string const & getName () const
 Gets the name of the character.
void setName (const std::string &name)
 Sets the name of the character.
int getGender () const
 Gets the gender of the character (male / female).
void setGender (int gender)
 Sets the gender of the character (male / female).
int getHairStyle () const
 Gets the hairstyle of the character.
void setHairStyle (int style)
 Sets the hairstyle of the character.
int getHairColor () const
 Gets the haircolor of the character.
void setHairColor (int color)
 Sets the haircolor of the character.
int getLevel () const
 Gets the level of the character.
void setLevel (int level)
 Sets the level of the character.
int getMoney () const
 Gets the amount of money the character has.
void setMoney (int amount)
 Sets the amount of money the character has.
unsigned short getBaseAttribute (int attributeNumber) const
 Gets the value of a base attribute of the character.
void setBaseAttribute (int attributeNumber, int value)
 Sets the value of a base attribute of the character.
int getMapId () const
 Gets the Id of the map that the character is on.
void setMapId (int mapId)
 Sets the Id of the map that the character is on.
Point const & getPosition () const
 Gets the position of the character on the map.
void setPosition (const Point &p)
 Sets the position of the character on the map.
int getNumberOfInventoryItems () const
 Returns the number of inventory items.
InventoryItem const & getInventoryItem (unsigned short slot) const
 Returns a reference to the item in inventory at slot.
void clearInventory ()
 Clears the inventory, in preperation for an update.
void addItemToInventory (const InventoryItem &item)
 Adds an inventory item to the inventory.

Private Member Functions

 CharacterData (CharacterData const &)
CharacterDataoperator= (CharacterData const &)

Private Attributes

int mDatabaseID
 Character database ID.
int mAccountID
 Account ID of the account the character belongs to.
std::string mName
 Name of the character.
unsigned char mGender
 Gender of the being.
unsigned char mHairStyle
 Hair Style of the being.
unsigned char mHairColor
 Hair Color of the being.
unsigned char mLevel
 Level of the being.
unsigned int mMoney
 Wealth of the being.
unsigned short mBaseAttributes [NB_BASE_ATTRIBUTES]
 character.
unsigned short mMapId
 Map the being is on.
Point mPos
 Position the being is at.
std::vector< InventoryItemmInventory
 All the possesions of the character.

Constructor & Destructor Documentation

CharacterData::CharacterData std::string const &  name,
int  id = -1
 

Definition at line 27 of file characterdata.cpp.

CharacterData::CharacterData MessageIn msg  ) 
 

Constructor used for creating a character from a serialised message.

Definition at line 37 of file characterdata.cpp.

CharacterData::CharacterData CharacterData const &   )  [private]
 


Member Function Documentation

void CharacterData::addItemToInventory const InventoryItem item  )  [virtual]
 

Adds an inventory item to the inventory.

Implements AbstractCharacterData.

Definition at line 55 of file characterdata.cpp.

void CharacterData::clearInventory  )  [inline, virtual]
 

Clears the inventory, in preperation for an update.

Implements AbstractCharacterData.

Definition at line 152 of file characterdata.hpp.

int CharacterData::getAccountID  )  const [inline]
 

Gets the account id of the account the character belongs to.

Definition at line 62 of file characterdata.hpp.

unsigned short CharacterData::getBaseAttribute int  attributeNumber  )  const [inline, virtual]
 

Gets the value of a base attribute of the character.

Implements AbstractCharacterData.

Definition at line 118 of file characterdata.hpp.

int CharacterData::getDatabaseID  )  const [inline, virtual]
 

Gets the database id of the character.

Implements AbstractCharacterData.

Definition at line 54 of file characterdata.hpp.

int CharacterData::getGender  )  const [inline, virtual]
 

Gets the gender of the character (male / female).

Implements AbstractCharacterData.

Definition at line 78 of file characterdata.hpp.

int CharacterData::getHairColor  )  const [inline, virtual]
 

Gets the haircolor of the character.

Implements AbstractCharacterData.

Definition at line 94 of file characterdata.hpp.

int CharacterData::getHairStyle  )  const [inline, virtual]
 

Gets the hairstyle of the character.

Implements AbstractCharacterData.

Definition at line 86 of file characterdata.hpp.

InventoryItem const & CharacterData::getInventoryItem unsigned short  slot  )  const [virtual]
 

Returns a reference to the item in inventory at slot.

Implements AbstractCharacterData.

Definition at line 49 of file characterdata.cpp.

int CharacterData::getLevel void   )  const [inline, virtual]
 

Gets the level of the character.

Implements AbstractCharacterData.

Definition at line 102 of file characterdata.hpp.

int CharacterData::getMapId  )  const [inline, virtual]
 

Gets the Id of the map that the character is on.

Implements AbstractCharacterData.

Definition at line 128 of file characterdata.hpp.

int CharacterData::getMoney  )  const [inline, virtual]
 

Gets the amount of money the character has.

Implements AbstractCharacterData.

Definition at line 110 of file characterdata.hpp.

std::string const& CharacterData::getName void   )  const [inline, virtual]
 

Gets the name of the character.

Implements AbstractCharacterData.

Definition at line 70 of file characterdata.hpp.

int CharacterData::getNumberOfInventoryItems  )  const [inline, virtual]
 

Returns the number of inventory items.

Implements AbstractCharacterData.

Definition at line 144 of file characterdata.hpp.

Point const& CharacterData::getPosition  )  const [inline, virtual]
 

Gets the position of the character on the map.

Implements AbstractCharacterData.

Definition at line 136 of file characterdata.hpp.

CharacterData& CharacterData::operator= CharacterData const &   )  [private]
 

void CharacterData::setAccountID int  id  )  [inline]
 

Sets the account id of the account the character belongs to.

Definition at line 66 of file characterdata.hpp.

void CharacterData::setBaseAttribute int  attributeNumber,
int  value
[inline, virtual]
 

Sets the value of a base attribute of the character.

Implements AbstractCharacterData.

Definition at line 123 of file characterdata.hpp.

void CharacterData::setDatabaseID int  id  )  [inline, virtual]
 

Sets the database id of the character.

Implements AbstractCharacterData.

Definition at line 58 of file characterdata.hpp.

void CharacterData::setGender int  gender  )  [inline, virtual]
 

Sets the gender of the character (male / female).

Implements AbstractCharacterData.

Definition at line 82 of file characterdata.hpp.

void CharacterData::setHairColor int  color  )  [inline, virtual]
 

Sets the haircolor of the character.

Implements AbstractCharacterData.

Definition at line 98 of file characterdata.hpp.

void CharacterData::setHairStyle int  style  )  [inline, virtual]
 

Sets the hairstyle of the character.

Implements AbstractCharacterData.

Definition at line 90 of file characterdata.hpp.

void CharacterData::setLevel int  level  )  [inline, virtual]
 

Sets the level of the character.

Implements AbstractCharacterData.

Definition at line 106 of file characterdata.hpp.

void CharacterData::setMapId int  mapId  )  [inline, virtual]
 

Sets the Id of the map that the character is on.

Implements AbstractCharacterData.

Definition at line 132 of file characterdata.hpp.

void CharacterData::setMoney int  amount  )  [inline, virtual]
 

Sets the amount of money the character has.

Implements AbstractCharacterData.

Definition at line 114 of file characterdata.hpp.

void CharacterData::setName const std::string &  name  )  [inline, virtual]
 

Sets the name of the character.

Implements AbstractCharacterData.

Definition at line 74 of file characterdata.hpp.

void CharacterData::setPosition const Point p  )  [inline, virtual]
 

Sets the position of the character on the map.

Implements AbstractCharacterData.

Definition at line 140 of file characterdata.hpp.


Member Data Documentation

int CharacterData::mAccountID [private]
 

Account ID of the account the character belongs to.

(-1) if not set yet.

Definition at line 164 of file characterdata.hpp.

unsigned short CharacterData::mBaseAttributes[NB_BASE_ATTRIBUTES] [private]
 

character.

Definition at line 172 of file characterdata.hpp.

int CharacterData::mDatabaseID [private]
 

Character database ID.

(-1) if not set yet.

Definition at line 162 of file characterdata.hpp.

unsigned char CharacterData::mGender [private]
 

Gender of the being.

Definition at line 167 of file characterdata.hpp.

unsigned char CharacterData::mHairColor [private]
 

Hair Color of the being.

Definition at line 169 of file characterdata.hpp.

unsigned char CharacterData::mHairStyle [private]
 

Hair Style of the being.

Definition at line 168 of file characterdata.hpp.

std::vector< InventoryItem > CharacterData::mInventory [private]
 

All the possesions of the character.

Definition at line 176 of file characterdata.hpp.

unsigned char CharacterData::mLevel [private]
 

Level of the being.

Definition at line 170 of file characterdata.hpp.

unsigned short CharacterData::mMapId [private]
 

Map the being is on.

Definition at line 174 of file characterdata.hpp.

unsigned int CharacterData::mMoney [private]
 

Wealth of the being.

Definition at line 171 of file characterdata.hpp.

std::string CharacterData::mName [private]
 

Name of the character.

Definition at line 166 of file characterdata.hpp.

Point CharacterData::mPos [private]
 

Position the being is at.

Definition at line 175 of file characterdata.hpp.


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 15:39:18 2007 for TMW Server by  doxygen 1.3.9.1