-
Notifications
You must be signed in to change notification settings - Fork 0
/
Item.cpp
36 lines (31 loc) · 775 Bytes
/
Item.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "Item.hpp"
Item::Item()
{
this->itemType = -1;
this->name = "EMPTY";
this->level = 0;
this->buyValue = 0;
this->sellValue = 0;
this->rarity = -1;
}
Item::Item(int itemType, int level, int rarity)
{
this->name = "RANDOM";
this->level = rand() % (level+2) + 1;
this->rarity = rarity;
this->buyValue = (this->level + this->rarity) + this->level*this->rarity*10;
this->sellValue = this->buyValue / 2;
this->itemType = itemType;
}
Item::Item(int itemType, std::string name, int level, int buyValue, int sellValue, int rarity)
{
this->itemType = itemType;
this->name = name;
this->level = level;
this->buyValue = buyValue;
this->sellValue = sellValue;
this->rarity = rarity;
}
Item::~Item()
{
}