-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeaCreatureBuilder.cpp
More file actions
37 lines (30 loc) · 926 Bytes
/
SeaCreatureBuilder.cpp
File metadata and controls
37 lines (30 loc) · 926 Bytes
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
#include "headerFiles/SeaCreatureBuilder.h"
#include "headerFiles/SeaCreature.h"
#include "headerFiles/SeaCreatureFactory.h"
SeaCreatureBuilder* SeaCreatureBuilder::setType(std::string type){
SeaCreatureBuilder::type = type;
return this;
}
SeaCreatureBuilder* SeaCreatureBuilder::setSpecie(std::string name){
SeaCreatureBuilder::specie = name;
return this;
}
SeaCreatureBuilder* SeaCreatureBuilder::setLength(int length){
SeaCreatureBuilder::length = length;
return this;
}
SeaCreatureBuilder* SeaCreatureBuilder::setHasEggs(bool hasEggs){
SeaCreatureBuilder::hasEggs = hasEggs;
return this;
}
SeaCreature* SeaCreatureBuilder::build(){
return SeaCreatureFactory::create(
SeaCreatureBuilder::type,
SeaCreatureBuilder::specie,
SeaCreatureBuilder::length,
SeaCreatureBuilder::hasEggs
);
}
std::string SeaCreatureBuilder::getType(){
return type;
}