-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathitem.cpp
44 lines (34 loc) · 843 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
37
38
39
40
41
42
43
44
#include "item.h"
Item::Item(){
name = " ";
description = " ";
weight = 0;
}
Item::Item(std::string _name, std::string _description, int _weight){
name = _name;
description = _description;
weight = _weight;
}
std::string Item::getDescription() const{
return description;
}
std::string Item::getName() const{
return name;
}
int Item::getWeight() const{
return weight;
}
void Item::setDescription(std::string _description){
description = _description;
}
void Item::setName(std::string _name){
name = _name;
}
void Item::setWeight(int _weight){
weight = _weight;
}
void Item::printItem(){
std::cout << name << ", Weight: " << weight << std::endl;
std::cout << "Description: " << description << std::endl;
}
int Item::execute(){return 0;}