]> jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/ArmorGO.cpp
Changed the ItemGO class to be abstract so you cannot define a simple ItemGO object...
[irc/gameservirc.git] / gameserv-2.0 / libgameservgldl / src / GameLayer / GameObjects / ArmorGO.cpp
1 #include <GameServ/GameLayer/GameObjects/ArmorGO.h>
2 using GameServ::GameLayer::GameObjects::ArmorGO;
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 ArmorGO::ArmorGO() : ItemGO()
20 {
21 }
22
23 ArmorGO::ArmorGO(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(strength, strength);
31 mModifiers[Modifiers::defense] = Range(defense, defense);
32 mModifiers[Modifiers::maxhealth] = Range(maxhealth, maxhealth);
33 }
34
35 ArmorGO::~ArmorGO()
36 {
37 }
38
39 ItemTypes::ItemType ArmorGO::Type(void) const
40 {
41 return ItemTypes::Armor;
42 }
43
44 ArmorGO *ArmorGO::Clone(void) const
45 {
46 return new ArmorGO(*this);
47 }
48
49
50
51
52
53
54