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