]> jfr.im git - irc/gameservirc.git/blob - gameserv/pouch.h
Added the USE command and a few other changes to code
[irc/gameservirc.git] / gameserv / pouch.h
1 #ifndef POUCH_H
2 #define POUCH_H
3
4 class Pouch {
5 public:
6
7 Pouch(int h = 0, int s = 0, int d = 0); // Default constructor
8
9 // Access functions to get the number of each potion in inventory
10 int Healing() { return healing; };
11 int Strength() { return strength; };
12 int Defense() { return defense; };
13
14 // Modifiers to set the number of potions
15 int setHealing (int h = 0) { healing = h; return Healing();};
16 int setStrength (int s = 0) { strength = s; return Strength(); };
17 int setDefense (int d = 0) { defense = d; return Defense();};
18
19 // Add one healing potion
20 int incHealing() { return setHealing(Healing() + 1); };
21
22 // Add one Strength potion
23 int incStrength() { return setStrength(Strength() + 1); };
24
25 // Add one Defense potion
26 int incDefense() { return setDefense(Defense() + 1); };
27
28 int decHealing() { return setHealing(Healing() - 1); };
29 int decStrength() { return setStrength(Strength() - 1); };
30 int decDefense() { return setDefense(Defense() - 1); };
31
32 // Reset all potions to 0
33 void reset() { setHealing(0); setStrength(0); setDefense(0); };
34
35 private:
36 // Potions
37 int healing;
38 int strength;
39 int defense;
40 };
41
42 #endif