]> jfr.im git - irc/gameservirc.git/blob - gameserv/pouch.h
Fixed the socket code to allow for host names in the gameserv.conf for remoteserver...
[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 int HP() { return hp; };
14
15 // Modifiers to set the number of potions
16 int setHealing (int h = 0) { healing = h; return Healing();};
17 int setStrength (int s = 0) { strength = s; return Strength(); };
18 int setDefense (int d = 0) { defense = d; return Defense();};
19 int setHP (int h = 0) { hp = h; return HP(); };
20
21 // Add one healing potion
22 int incHealing() { return setHealing(Healing() + 1); };
23
24 // Add one Strength potion
25 int incStrength() { return setStrength(Strength() + 1); };
26
27 // Add one Defense potion
28 int incDefense() { return setDefense(Defense() + 1); };
29
30 // Add one Max HP Potion
31 int incHP() { return setHP(HP() + 1); };
32
33 int decHealing() { return setHealing(Healing() - 1); };
34 int decStrength() { return setStrength(Strength() - 1); };
35 int decDefense() { return setDefense(Defense() - 1); };
36 int decHP() { return setHP(HP() - 1); };
37
38 void setInventory(Pouch *right) { setHealing(right->Healing());
39 setStrength(right->Strength());
40 setDefense(right->Defense());
41 setHP(right->HP());
42 };
43 // Reset all potions to 0
44 void reset() { setHealing(0); setStrength(0); setDefense(0);
45 setHP(0);};
46
47 private:
48 // Potions
49 int healing;
50 int strength;
51 int defense;
52 int hp;
53 };
54
55 #endif