]> jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/PotionGO.cpp
Changed Range to be a template class so it can be used with unsigned & signed ints...
[irc/gameservirc.git] / gameserv-2.0 / libgameservgldl / src / GameLayer / GameObjects / PotionGO.cpp
1 #include <GameServ/GameLayer/GameObjects/PotionGO.h>
2 using GameServ::GameLayer::GameObjects::PotionGO;
3
4 #include <GameServ/Types.h>
5 using GameServ::Types::Modifiers;
6 using GameServ::Types::ItemTypes;
7
8 #include <string>
9 using std::string;
10 #include <map>
11 using std::map;
12
13 #include <boost/format.hpp>
14 #include <boost/algorithm/string.hpp>
15 using boost::format;
16 using boost::str;
17
18
19 PotionGO::PotionGO() : ItemGO()
20 {
21 }
22
23 PotionGO::PotionGO(const string &name, const int &price, const int &uses, const int &strength, const int &defense, const int &maxhealth) :
24 ItemGO()
25 {
26 mName = name;
27 mPrice = price;
28 mUses = uses;
29 mModifiers.clear();
30 mModifiers[Modifiers::strength] = Range<int>(strength, strength);
31 mModifiers[Modifiers::defense] = Range<int>(defense, defense);
32 mModifiers[Modifiers::maxhealth] = Range<int>(maxhealth, maxhealth);
33 }
34
35 PotionGO::~PotionGO()
36 {
37 }
38
39 ItemTypes::ItemType PotionGO::Type(void) const
40 {
41 return ItemTypes::Potion;
42 }
43
44 ItemGO *PotionGO::Clone(void) const
45 {
46 return new PotionGO(*this);
47 }
48
49
50
51
52
53
54