AbstractCharacterData Class Reference

#include <abstractcharacterdata.hpp>

Inheritance diagram for AbstractCharacterData:

Character CharacterData List of all members.

Public Member Functions

virtual ~AbstractCharacterData ()
 Empty virtual destructor.
void serialize (MessageOut &) const
 Stores data into a outgoing message.
void deserialize (MessageIn &)
 Restores data from a incomming message.

Protected Member Functions

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

Constructor & Destructor Documentation

virtual AbstractCharacterData::~AbstractCharacterData  )  [inline, virtual]
 

Empty virtual destructor.

Definition at line 67 of file abstractcharacterdata.hpp.


Member Function Documentation

virtual void AbstractCharacterData::addItemToInventory const InventoryItem item  )  [protected, pure virtual]
 

Adds an inventory item to the inventory.

Implemented in CharacterData, and Character.

virtual void AbstractCharacterData::clearInventory  )  [protected, pure virtual]
 

Clears the inventory, in preperation for an update.

Implemented in CharacterData, and Character.

void AbstractCharacterData::deserialize MessageIn msg  ) 
 

Restores data from a incomming message.

TODO: uncomment/redesign after Inventory is redesigned/improved TODO: Test and debug.

clearInventory();

byte = 1, short = 2 while (msg.getUnreadLength() >= 5) { InventoryItem tempItem; tempItem.itemClassId = msg.readShort(); tempItem.numberOfItemsInSlot = msg.readShort(); tempItem.isEquiped = (bool) msg.readByte(); addItemToInventory(tempItem); }

Definition at line 62 of file abstractcharacterdata.cpp.

virtual unsigned short AbstractCharacterData::getBaseAttribute int  attributeNumber  )  const [protected, pure virtual]
 

Gets the value of a base attribute of the character.

Implemented in CharacterData, and Character.

virtual int AbstractCharacterData::getDatabaseID  )  const [protected, pure virtual]
 

Gets the database id of the character.

Implemented in CharacterData, and Character.

virtual int AbstractCharacterData::getGender  )  const [protected, pure virtual]
 

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

Implemented in CharacterData, and Character.

virtual int AbstractCharacterData::getHairColor  )  const [protected, pure virtual]
 

Gets the haircolor of the character.

Implemented in CharacterData, and Character.

virtual int AbstractCharacterData::getHairStyle  )  const [protected, pure virtual]
 

Gets the hairstyle of the character.

Implemented in CharacterData, and Character.

virtual InventoryItem const& AbstractCharacterData::getInventoryItem unsigned short  slot  )  const [protected, pure virtual]
 

Returns a reference to the item in inventory at slot.

Implemented in CharacterData, and Character.

virtual int AbstractCharacterData::getLevel  )  const [protected, pure virtual]
 

Gets the level of the character.

Implemented in CharacterData, and Character.

virtual int AbstractCharacterData::getMapId  )  const [protected, pure virtual]
 

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

Implemented in CharacterData, and Character.

virtual int AbstractCharacterData::getMoney  )  const [protected, pure virtual]
 

Gets the amount of money the character has.

Implemented in CharacterData, and Character.

virtual std::string const& AbstractCharacterData::getName  )  const [protected, pure virtual]
 

Gets the name of the character.

Implemented in CharacterData, and Character.

virtual int AbstractCharacterData::getNumberOfInventoryItems  )  const [protected, pure virtual]
 

Returns the number of inventory items.

Implemented in CharacterData, and Character.

virtual Point const& AbstractCharacterData::getPosition  )  const [protected, pure virtual]
 

Gets the position of the character on the map.

Implemented in CharacterData, and Character.

void AbstractCharacterData::serialize MessageOut msg  )  const
 

Stores data into a outgoing message.

TODO: uncomment/redesign after Inventory is redesigned/improved TODO: Test and debug.

for (int j = 0; j < getNumberOfInventoryItems(); ++j) { msg.writeShort(getInventoryItem(j).itemClassId); msg.writeShort(getInventoryItem(j).numberOfItemsInSlot); msg.writeByte((char)getInventoryItem(j).isEquiped); }

Definition at line 30 of file abstractcharacterdata.cpp.

virtual void AbstractCharacterData::setBaseAttribute int  attributeNumber,
int  value
[protected, pure virtual]
 

Sets the value of a base attribute of the character.

Implemented in CharacterData, and Character.

virtual void AbstractCharacterData::setDatabaseID int  id  )  [protected, pure virtual]
 

Sets the database id of the character.

Implemented in CharacterData, and Character.

virtual void AbstractCharacterData::setGender int  gender  )  [protected, pure virtual]
 

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

Implemented in CharacterData, and Character.

virtual void AbstractCharacterData::setHairColor int  color  )  [protected, pure virtual]
 

Sets the haircolor of the character.

Implemented in CharacterData, and Character.

virtual void AbstractCharacterData::setHairStyle int  style  )  [protected, pure virtual]
 

Sets the hairstyle of the character.

Implemented in CharacterData, and Character.

virtual void AbstractCharacterData::setLevel int  level  )  [protected, pure virtual]
 

Sets the level of the character.

Implemented in CharacterData, and Character.

virtual void AbstractCharacterData::setMapId int  mapId  )  [protected, pure virtual]
 

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

Implemented in CharacterData, and Character.

virtual void AbstractCharacterData::setMoney int  amount  )  [protected, pure virtual]
 

Sets the amount of money the character has.

Implemented in CharacterData, and Character.

virtual void AbstractCharacterData::setName const std::string &  name  )  [protected, pure virtual]
 

Sets the name of the character.

Implemented in CharacterData, and Character.

virtual void AbstractCharacterData::setPosition const Point p  )  [protected, pure virtual]
 

Sets the position of the character on the map.

Implemented in CharacterData, and Character.


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