diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-07-07 16:50:47 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-07-07 16:50:47 +0000 |
commit | 04e694b067a21dee8e13368c17d1815cc0624ce4 (patch) | |
tree | a57ab98d76040838fa369e6823544baeb19d1bbc /src/game-server/character.hpp | |
parent | 60b4a57bdfe664a6729b3573a6a614621b6c2b2c (diff) | |
download | manaserv-04e694b067a21dee8e13368c17d1815cc0624ce4.tar.gz manaserv-04e694b067a21dee8e13368c17d1815cc0624ce4.tar.bz2 manaserv-04e694b067a21dee8e13368c17d1815cc0624ce4.tar.xz manaserv-04e694b067a21dee8e13368c17d1815cc0624ce4.zip |
Simplified code by using map pointers only, instead of using both map IDs and map pointers.
Diffstat (limited to 'src/game-server/character.hpp')
-rw-r--r-- | src/game-server/character.hpp | 82 |
1 files changed, 11 insertions, 71 deletions
diff --git a/src/game-server/character.hpp b/src/game-server/character.hpp index 275b5e67..15c72a3d 100644 --- a/src/game-server/character.hpp +++ b/src/game-server/character.hpp @@ -26,8 +26,8 @@ #include <string> #include <vector> -#include "game-server/being.hpp" #include "common/inventorydata.hpp" +#include "game-server/being.hpp" class GameClient; class MessageIn; @@ -154,21 +154,15 @@ class Character : public Being /** * Gets the value of an attribute of the character. - * Inherited from Being, explicitly defined because - * of double inheritance. */ - unsigned short - getBaseAttribute(int attributeNumber) const - { return Being::getAttribute(attributeNumber); } + int getBaseAttribute(int attributeNumber) const + { return getAttribute(attributeNumber); } /** * Sets the value of an attribute of the character. - * Inherited from Being, explicitly defined because - * of double inheritance. */ - void - setBaseAttribute(int attributeNumber, int value) - { Being::setAttribute(attributeNumber, value); } + void setBaseAttribute(int attributeNumber, int value) + { setAttribute(attributeNumber, value); } /** * Creates a message that informs the client about the attribute @@ -178,70 +172,16 @@ class Character : public Being writeAttributeUpdateMessage(MessageOut &msg); /** - * Gets the Id of the map that the character is on. - * Inherited from Thing through Being, explicitly defined because - * of double inheritance. - */ - int - getMapId() const - { return Being::getMapId(); } - - /** - * Sets the Id of the map that the character is on. - * Inherited from Thing through Being, explicitly defined because - * of double inheritance. - */ - void - setMapId(int mapId) - { Being::setMapId(mapId); } - - /** - * Gets the position of the character on the map. - * Inherited from Object through Being, explicitly defined because - * of double inheritance. - */ - Point const & - getPosition() const - { return Being::getPosition(); } - - /** - * Sets the position of the character on the map. - * Inherited from Object through Being, explicitly defined because - * of double inheritance. + * Gets the ID of the map that the character is on. + * For serialization purpose only. */ - void - setPosition(const Point &p) - { Being::setPosition(p); } + int getMapId() const; /** - * The access functions for inventory - * - * Currently not implemented + * Sets the ID of the map that the character is on. + * For serialization purpose only. */ - - /** - * Returns the number of inventory items. - * (items don't have to be unique) - * TODO: maybe renaming to NumberOfFilledSlots would be better. - */ - int - getNumberOfInventoryItems() const; - - /** - * Returns a reference to the item in inventory at slot. - * TODO: Keep this consistent with whatever is chosen for - * getNumberOfInventoryItems. - */ - InventoryItem const & - getInventoryItem(unsigned short slot) const; - - /** Clears the inventory, in preperation for an update. */ - void - clearInventory(); - - /** Adds an inventory item to the inventory. */ - void - addItemToInventory(const InventoryItem& item); + void setMapId(int); protected: /** |