-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathISSMemento.cpp
50 lines (38 loc) · 949 Bytes
/
ISSMemento.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
#include "ISSMemento.h"
ISSMemento::ISSMemento(vector<crew*> crewV, vector<cargo*> cargoV, docked_state* ds)
{
vector<crew*> tempnames;
int csize = crewV.size();
for(int i = 0; i < csize; i++)
{
string tempc = crewV.back()->getName();
crewmembers.push_back(tempc);
tempnames.push_back(crewV.back());
crewV.pop_back();
}
vector<cargo*> tempcnames;
csize = cargoV.size();
for(int i = 0; i < csize; i++)
{
string tempca = cargoV.back()->getName();
cargohold.push_back(tempca);
tempcnames.push_back(cargoV.back());
cargoV.pop_back();
}
this->state = ds->clone();
}
ISSMemento::~ISSMemento()
{
}
docked_state* ISSMemento::getState()
{
return state;
}
vector<string> ISSMemento::getcrew()
{
return crewmembers;
}
vector<string> ISSMemento::getcargo()
{
return cargohold;
}