-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcombine.cpp
62 lines (52 loc) · 1.16 KB
/
combine.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* @file Combine.cpp
*
* Provides combine functionality in the game.
* An object consists of its id, the id of the first
* item that can be combined, and the id of the second object
* that can be combined.
*
* @brief Source file for Combine functionality.
*
* @author Michael Abrams
* @author James Boocock
* @author Toby Herbert
* @author Tatai Nikora
* @version 0.3
*/
#include "combine.h"
#include "Item.h"
combine::combine(std::string id,std::string first, std::string second_id){
this->description = NULL;
this->id = id;
this->first_id = first;
this->second_id = second_id;
}
void combine::set_description(StateDescriptor * d){
this->description = d;
}
std::string combine::get_description(){
return this->description->get_description();
}
combine::~combine(){
if(combination!=NULL){
delete combination;
}
}
Item* combine::get_combination(){
Item* temp = combination;
combination = NULL;
return temp;
}
void combine::set_combination(Item * item){
this->combination = item;
}
std::string combine::get_id(){
return id;
}
std::string combine::get_second_id(){
return second_id;
}
std::string combine::get_first_id(){
return first_id;
}