diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-08-18 02:24:44 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-08-18 02:24:44 +0200 |
commit | f8551d9ef4a745327bccb9e4cb54a22f6a28cf80 (patch) | |
tree | 9af300838e58e2e2c7aeaca5765e7dbbb30d8b6d /src/equipment.h | |
parent | 3b7740f133e195b0a0b11090ea8c2b8a7b64411c (diff) | |
download | mana-f8551d9ef4a745327bccb9e4cb54a22f6a28cf80.tar.gz mana-f8551d9ef4a745327bccb9e4cb54a22f6a28cf80.tar.bz2 mana-f8551d9ef4a745327bccb9e4cb54a22f6a28cf80.tar.xz mana-f8551d9ef4a745327bccb9e4cb54a22f6a28cf80.zip |
Made the client able to successfully equip/unequip!
Diffstat (limited to 'src/equipment.h')
-rw-r--r-- | src/equipment.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/equipment.h b/src/equipment.h index 67317d39..564eb2ee 100644 --- a/src/equipment.h +++ b/src/equipment.h @@ -22,6 +22,8 @@ #ifndef EQUIPMENT_H #define EQUIPMENT_H +#include <string> + class Item; class Equipment @@ -33,16 +35,33 @@ class Equipment class Backend { public: - virtual Item *getEquipment(int index) const = 0; + virtual Item *getEquipment(int slotIndex) const = 0; + virtual std::string getSlotName(int slotIndex) const + { return std::string(); } + virtual void clear() = 0; virtual ~Backend() { } + virtual int getSlotNumber() const = 0; + virtual void triggerUnequip(int slotIndex) const = 0; + private: + virtual void readEquipFile() + {} }; /** * Get equipment at the given slot. */ - Item *getEquipment(int index) const - { return mBackend ? mBackend->getEquipment(index) : 0; } + Item *getEquipment(int slotIndex) const + { return mBackend ? mBackend->getEquipment(slotIndex) : 0; } + + const std::string getSlotName(int slotIndex) const + { return mBackend ? mBackend->getSlotName(slotIndex) : std::string(); } + + int getSlotNumber() const + { return mBackend ? mBackend->getSlotNumber() : 0; } + + void triggerUnequip(int slotIndex) const + { if (mBackend) mBackend->triggerUnequip(slotIndex); } /** * Clears equipment. |