-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem.cpp
42 lines (33 loc) · 852 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
/*This will define the member funtions and constructors of the Item class*/
//preprocessor
#include "item.h"
//constructor definitions
Item::Item() {
name = "item";
desc = "\tThis is an item with no description.\n";
}
Item::Item(string name0) {
name = name0;
desc = "\tThis is an item with no description.\n";
}
Item::Item(string name0, string desc0) {
name = name0;
desc = desc0;
}
//operator overloading definitions
bool Item::operator==(const Item& other_item) {
return (this->name == other_item.name) && (this->desc == other_item.desc);
}
//member function definitions
string Item::get_name() {
return name;
}
string Item::get_desc() {
return desc;
}
void Item::set_name(string name0) {
name = name0;
}
void Item::set_desc(string desc0) {
desc = desc0;
}