-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeaPlusPlusEngine.cpp
More file actions
43 lines (34 loc) · 1.01 KB
/
SeaPlusPlusEngine.cpp
File metadata and controls
43 lines (34 loc) · 1.01 KB
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
#include "headerFiles/SeaPlusPlusEngine.h"
#include "headerFiles/SeaCheckerFactory.h"
#include "headerFiles/SeaCreature.h"
SeaPlusPlusEngine::SeaPlusPlusEngine(){
builder = new SeaCreatureBuilder();
checker = nullptr;
currentCreature = nullptr;
}
SeaPlusPlusEngine::~SeaPlusPlusEngine(){
if (builder) delete builder;
if (checker) delete checker;
if (currentCreature) delete currentCreature;
}
void SeaPlusPlusEngine::setCreatureType(std::string type){
builder->setType(type);
}
void SeaPlusPlusEngine::setCreatureSpecie(std::string specie){
builder->setSpecie(specie);
}
void SeaPlusPlusEngine::setCreatureLength(int length){
builder->setLength(length);
}
void SeaPlusPlusEngine::setCreatureHasEggs(bool hasEggs){
builder->setHasEggs(hasEggs);
}
std::string SeaPlusPlusEngine::getCreatureType(){
return builder->getType();
}
SeaCreature* SeaPlusPlusEngine::getCreature(){
return currentCreature;
}
void SeaPlusPlusEngine::buildCreature(){
currentCreature = builder->build();
}