-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreature.cpp
More file actions
45 lines (41 loc) · 1.69 KB
/
Copy pathcreature.cpp
File metadata and controls
45 lines (41 loc) · 1.69 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
44
45
/*/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/*/
/*/
All stuff regarding creatures encapsuled.
/*/
/*/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/*/
#include "creature.hpp"
#include <fstream>
#include <iostream>
#include <vector>
#include <string>
/*/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/*/
/*/ class CreatureData /*/
/*/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/*/
// default position value is zero.
Creature::Creature(const std::string &creaturename,
size_t strength,
size_t speed,
size_t lifetime,
const std::vector<std::string> &properties,
const std::string &figurepath,
CreatureTileType creatureTileType
)
: creaturename(creaturename), strength(strength), speed(speed), lifetime(lifetime),
properties(properties), figurepath(figurepath),
// default setting of position and creatureTileType
positionX(0), positionY(0), creatureTileType(creatureTileType) {
// due to default type being Terestial it only needs to be changed to water type
}
void Creature::printCreatureDataToConsole() const {
std::cout << this->creaturename << "\n";
std::cout << this->strength << "\n";
std::cout << this->speed << "\n";
std::cout << this->lifetime << "\n";
for (int i = 0; i < this->properties.size(); i++) {
std::cout << this->properties[i] << "\n";
}
std::cout << this->figurepath << "\n";
std::cout << this->positionX << "\n";
std::cout << this->positionY << "\n";
return;
}