-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItem.h
41 lines (37 loc) · 880 Bytes
/
Item.h
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
38
39
40
41
#pragma once
#include "ItemDef.h"
class Item
{
private:
unsigned char* x;
unsigned char* y;
unsigned char* symbol;
std::string* name;
std::string* description;
short* color;
Dice* damage;
Dice* hit;
Dice* dodge;
Dice* attribute;
unsigned int* type;
unsigned int* weight;
unsigned int* speed;
unsigned int* value;
public:
~Item();
Item(unsigned char x, unsigned char y);
Item(unsigned char x, unsigned char y, ItemDef *def);
inline char getSymbol() {return *symbol;}
inline short getColor() {return *color;}
inline unsigned int rollDamage() {return damage->Roll();}
inline std::string getName() {return *name;}
inline unsigned int getType() {
return *type;
}
friend std::ostream &operator<<(std::ostream &o, Item &i);
};
inline std::ostream &operator<<(std::ostream &o, Item &i)
{
o << i.symbol;
return o;
}