-
Notifications
You must be signed in to change notification settings - Fork 0
/
Animal.cpp
42 lines (31 loc) · 992 Bytes
/
Animal.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
//
// Created by Dominic Rutkowski on 2019-04-10.
//
#include "Animal.hpp"
namespace cs3210 {
Animal::Animal(const std::string& symbol, const unsigned int maxEnergy, unsigned int energy,
const AnimalType& animalType, const std::vector<std::string>& foodChain):
Organism(symbol, maxEnergy, energy), animalType{animalType}, foodChain{foodChain},
moved{false} {}
const std::vector<std::string>& Animal::getFoodChain() const {
return foodChain;
}
void Animal::setMoved(bool moved) {
this->moved = moved;
}
void Animal::setReproduced(bool reproduced) {
this->reproduced = reproduced;
}
bool Animal::hasMoved() const {
return moved;
}
bool Animal::hasReproduced() const {
return reproduced;
}
std::string Animal::toString() const {
return symbol;
}
AnimalType Animal::getAnimalType() const {
return animalType;
}
}