-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItem.cpp
37 lines (36 loc) · 1.03 KB
/
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
37
#include "Item.h"
Item::Item(unsigned char x, unsigned char y)
{
this->x = new unsigned char (x);
this->y = new unsigned char (y);
ItemDef* def = ItemDef::getRandom();
this->symbol = new unsigned char (def->getSymbol());
this->name = new std::string(def->getName());
this->description = new std::string(def->getDescription().c_str());
this->color = new short (def->getColor());
this->damage = new Dice(def->getDamage());
this->hit = new Dice(def->getHit());
this->dodge = new Dice(def->getDodge());
this->attribute = new Dice(def->getAttribute());
this->type = new unsigned int (def->getType());
this->weight = new unsigned int (def->getWeight().Roll());
this->speed = new unsigned int (def->getSpeed().Roll());
this->value = new unsigned int (def->getValue().Roll());
}
Item::~Item()
{
delete x;
delete y;
delete symbol;
delete name;
delete description;
delete color;
delete damage;
delete hit;
delete dodge;
delete attribute;
delete type;
delete weight;
delete speed;
delete value;
}