#include <character.hpp>
Inheritance diagram for Character:

Definition at line 46 of file character.hpp.
Public Member Functions | |
| Character (MessageIn &msg) | |
| Utility constructor for creating a Character from a received characterdata message. | |
| void | update () |
| Updates the internal status. | |
| GameClient * | getClient () const |
| Gets client computer. | |
| void | setClient (GameClient *c) |
| Sets client computer. | |
| Possessions & | getPossessions () |
| Gets a reference on the possession. | |
| int | getDatabaseID () const |
| Gets the database id of the character. | |
| void | setDatabaseID (int id) |
| Sets the database id of the character. | |
| 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 or female). | |
| void | setGender (int gender) |
| Sets the gender of the character (male or 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 an attribute of the character. | |
| void | setBaseAttribute (int attributeNumber, int value) |
| Sets the value of an attribute of the character. | |
| void | writeAttributeUpdateMessage (MessageOut &msg) |
| Creates a message that informs the client about the attribute changes since last call. | |
| 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. | |
Protected Member Functions | |
| void | calculateDerivedAttributes () |
| Calculates all derived attributes. | |
| virtual WeaponStats | getWeaponStats () |
| Gets the stats of the currently equipped weapon that are relevant for damage calculation. | |
Private Member Functions | |
| Character (Character const &) | |
| Character & | operator= (Character const &) |
Private Attributes | |
| GameClient * | mClient |
| Client computer. | |
| std::vector< unsigned short > | mOldAttributes |
| Atributes as the client should currently know them. | |
| bool | mAttributesChanged |
| true when one or more attributes might have changed since the client has been updated about them. | |
| int | mDatabaseID |
| Character's database ID. | |
| std::string | mName |
| Name of the character. | |
| unsigned char | mGender |
| Gender of the character. | |
| unsigned char | mHairStyle |
| Hair Style of the character. | |
| unsigned char | mHairColor |
| Hair Color of the character. | |
| unsigned char | mLevel |
| Level of the character. | |
| unsigned int | mMoney |
| Wealth of the being. | |
| Possessions | mPossessions |
| Possesssions of the character. | |
|
|
Utility constructor for creating a Character from a received characterdata message.
Definition at line 33 of file character.cpp. |
|
|
|
|
|
Adds an inventory item to the inventory.
Implements AbstractCharacterData. Definition at line 99 of file character.cpp. |
|
|
Calculates all derived attributes.
Reimplemented from Being. Definition at line 104 of file character.cpp. |
|
|
Clears the inventory, in preperation for an update.
Implements AbstractCharacterData. Definition at line 93 of file character.cpp. |
|
|
Gets the value of an attribute of the character. Inherited from Being, explicitly defined because of double inheritance. Implements AbstractCharacterData. Definition at line 162 of file character.hpp. |
|
|
Gets client computer.
Definition at line 64 of file character.hpp. |
|
|
Gets the database id of the character.
Implements AbstractCharacterData. Definition at line 88 of file character.hpp. |
|
|
Gets the gender of the character (male or female).
Implements AbstractCharacterData. Definition at line 108 of file character.hpp. |
|
|
Gets the haircolor of the character.
Implements AbstractCharacterData. Definition at line 128 of file character.hpp. |
|
|
Gets the hairstyle of the character.
Implements AbstractCharacterData. Definition at line 118 of file character.hpp. |
|
|
Returns a reference to the item in inventory at slot. TODO: Keep this consistent with whatever is chosen for getNumberOfInventoryItems. Implements AbstractCharacterData. Definition at line 80 of file character.cpp. |
|
|
Gets the level of the character.
Implements AbstractCharacterData. Definition at line 138 of file character.hpp. |
|
|
Gets the Id of the map that the character is on. Inherited from Thing through Being, explicitly defined because of double inheritance. Implements AbstractCharacterData. Definition at line 187 of file character.hpp. |
|
|
Gets the amount of money the character has.
Implements AbstractCharacterData. Definition at line 148 of file character.hpp. |
|
|
Gets the name of the character.
Implements AbstractCharacterData. Definition at line 98 of file character.hpp. |
|
|
Returns the number of inventory items. (items don't have to be unique) TODO: maybe renaming to NumberOfFilledSlots would be better. Implements AbstractCharacterData. Definition at line 73 of file character.cpp. |
|
|
Gets the position of the character on the map. Inherited from Object through Being, explicitly defined because of double inheritance. Implements AbstractCharacterData. Definition at line 205 of file character.hpp. |
|
|
Gets a reference on the possession. Used in the current Inventory class Definition at line 77 of file character.hpp. |
|
|
Gets the stats of the currently equipped weapon that are relevant for damage calculation.
Reimplemented from Being. Definition at line 115 of file character.cpp. |
|
|
|
|
||||||||||||
|
Sets the value of an attribute of the character. Inherited from Being, explicitly defined because of double inheritance. Implements AbstractCharacterData. Definition at line 171 of file character.hpp. |
|
|
Sets client computer.
Definition at line 70 of file character.hpp. |
|
|
Sets the database id of the character.
Implements AbstractCharacterData. Definition at line 93 of file character.hpp. |
|
|
Sets the gender of the character (male or female).
Implements AbstractCharacterData. Definition at line 113 of file character.hpp. |
|
|
Sets the haircolor of the character.
Implements AbstractCharacterData. Definition at line 133 of file character.hpp. |
|
|
Sets the hairstyle of the character.
Implements AbstractCharacterData. Definition at line 123 of file character.hpp. |
|
|
Sets the level of the character.
Implements AbstractCharacterData. Definition at line 143 of file character.hpp. |
|
|
Sets the Id of the map that the character is on. Inherited from Thing through Being, explicitly defined because of double inheritance. Implements AbstractCharacterData. Definition at line 196 of file character.hpp. |
|
|
Sets the amount of money the character has.
Implements AbstractCharacterData. Definition at line 153 of file character.hpp. |
|
|
Sets the name of the character.
Implements AbstractCharacterData. Definition at line 103 of file character.hpp. |
|
|
Sets the position of the character on the map. Inherited from Object through Being, explicitly defined because of double inheritance. Implements AbstractCharacterData. Definition at line 214 of file character.hpp. |
|
|
Updates the internal status.
Implements Thing. Definition at line 56 of file character.cpp. |
|
|
Creates a message that informs the client about the attribute changes since last call.
Definition at line 130 of file character.cpp. |
|
|
true when one or more attributes might have changed since the client has been updated about them.
Definition at line 272 of file character.hpp. |
|
|
Client computer.
Definition at line 263 of file character.hpp. |
|
|
Character's database ID.
Definition at line 274 of file character.hpp. |
|
|
Gender of the character.
Definition at line 276 of file character.hpp. |
|
|
Hair Color of the character.
Definition at line 278 of file character.hpp. |
|
|
Hair Style of the character.
Definition at line 277 of file character.hpp. |
|
|
Level of the character.
Definition at line 279 of file character.hpp. |
|
|
Wealth of the being.
Definition at line 280 of file character.hpp. |
|
|
Name of the character.
Definition at line 275 of file character.hpp. |
|
|
Atributes as the client should currently know them.
Definition at line 266 of file character.hpp. |
|
|
Possesssions of the character.
Definition at line 282 of file character.hpp. |
1.3.9.1