summaryrefslogtreecommitdiff
path: root/src/equipment.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-07-21 20:19:25 -0600
committerJared Adams <jaxad0127@gmail.com>2009-07-21 20:21:55 -0600
commit4cc7305cfa08598398123641987cf1fdf2bd7616 (patch)
treecdf406f0c943201e98a9787fbe1a1f760bb0e22f /src/equipment.h
parentce3d5a56de1309298603c9ce3b95659829f870ef (diff)
downloadmana-client-4cc7305cfa08598398123641987cf1fdf2bd7616.tar.gz
mana-client-4cc7305cfa08598398123641987cf1fdf2bd7616.tar.bz2
mana-client-4cc7305cfa08598398123641987cf1fdf2bd7616.tar.xz
mana-client-4cc7305cfa08598398123641987cf1fdf2bd7616.zip
Merge equipment handling and fix some bugs
Diffstat (limited to 'src/equipment.h')
-rw-r--r--src/equipment.h56
1 files changed, 17 insertions, 39 deletions
diff --git a/src/equipment.h b/src/equipment.h
index 5bebf78d..c7058269 100644
--- a/src/equipment.h
+++ b/src/equipment.h
@@ -22,11 +22,7 @@
#ifndef EQUIPMENT_H
#define EQUIPMENT_H
-#ifdef TMWSERV_SUPPORT
#define EQUIPMENT_SIZE 11
-#else
-#define EQUIPMENT_SIZE 10
-#endif
class Item;
@@ -38,63 +34,45 @@ class Equipment
*/
Equipment();
-#ifdef TMWSERV_SUPPORT
/**
* Destructor.
*/
~Equipment();
-#endif
+
+ enum EquipmentSlots
+ {
+ EQUIP_TORSO_SLOT = 0,
+ EQUIP_GLOVES_SLOT = 1,
+ EQUIP_HEAD_SLOT = 2,
+ EQUIP_LEGS_SLOT = 3,
+ EQUIP_FEET_SLOT = 4,
+ EQUIP_RING1_SLOT = 5,
+ EQUIP_RING2_SLOT = 6,
+ EQUIP_NECK_SLOT = 7,
+ EQUIP_FIGHT1_SLOT = 8,
+ EQUIP_FIGHT2_SLOT = 9,
+ EQUIP_PROJECTILE_SLOT = 10,
+ EQUIP_VECTOREND
+ };
/**
* Get equipment at the given slot.
*/
-#ifdef TMWSERV_SUPPORT
Item *getEquipment(int index)
-#else
- int getEquipment(int index) const
-#endif
{ return mEquipment[index]; }
-#ifdef TMWSERV_SUPPORT
/**
* Clears equipment.
*/
void clear();
-#endif
/**
* Set equipment at the given slot.
*/
-#ifdef TMWSERV_SUPPORT
- void setEquipment(int index, int id);
-#else
- void setEquipment(int index, int inventoryIndex);
-#endif
-
-#ifdef EATHENA_SUPPORT
- /**
- * Remove equipment from the given slot.
- */
- void removeEquipment(int index);
-
- /**
- * Returns the item used in the arrow slot.
- */
- int getArrows() const { return mArrows; }
-
- /**
- * Set the item used in the arrow slot.
- */
- void setArrows(int arrows) { mArrows = arrows; }
-#endif
+ void setEquipment(int index, int id, int quantity = 0);
private:
-#ifdef TMWSERV_SUPPORT
Item *mEquipment[EQUIPMENT_SIZE];
-#else
- int mEquipment[EQUIPMENT_SIZE];
- int mArrows;
-#endif
};
#endif