]> jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/ItemGO.cpp
Fixed up Modifiers for items
[irc/gameservirc.git] / gameserv-2.0 / libgameservgldl / src / GameLayer / GameObjects / ItemGO.cpp
1 #include <GameServ/GameLayer/GameObjects/ItemGO.h>
2 using GameServ::GameLayer::GameObjects::ItemGO;
3
4 #include <GameServ/Types.h>
5 using GameServ::Types::ItemTypes;
6 using GameServ::Types::Modifiers;
7
8 #include <string>
9 using std::string;
10 #include <map>
11 using std::map;
12
13 #include <boost/smart_ptr/shared_ptr.hpp>
14 using boost::shared_ptr;
15
16 ItemGO::ItemGO() : GameObject(), mName(""), mPrice(0), mUses(1), mType(ItemTypes::NOTYPE)
17 {
18 }
19
20 ItemGO::~ItemGO()
21 {
22 }
23
24 string ItemGO::Name(void) const
25 {
26 return mName;
27 }
28
29 void ItemGO::Name(const string &value)
30 {
31 mName = value;
32 }
33
34 unsigned long int ItemGO::Price(void) const
35 {
36 return mPrice;
37 }
38
39 void ItemGO::Price(const unsigned long int &price)
40 {
41 mPrice = price;
42 }
43
44 int ItemGO::Uses(void) const
45 {
46 return mUses;
47 }
48
49 void ItemGO::Uses(const int &value)
50 {
51 mUses = value;
52 }
53
54 ItemTypes::ItemType ItemGO::Type(void) const
55 {
56 return mType;
57 }
58
59 void ItemGO::Type(const ItemTypes::ItemType &value)
60 {
61 mType = value;
62 }
63
64 map<Modifiers::Modifier, int> ItemGO::Modifiers(void) const
65 {
66 return mModifiers;
67 }
68
69 void ItemGO::Modifiers(const map<Modifiers::Modifier, int> &modifiers)
70 {
71 mModifiers.clear();
72 mModifiers.insert(modifiers.begin(), modifiers.end());
73 }
74
75 ItemGO *ItemGO::Clone(void) const
76 {
77 return new ItemGO(*this);
78 }
79
80
81
82
83
84
85