-
Notifications
You must be signed in to change notification settings - Fork 0
/
Animal.hpp
37 lines (29 loc) · 993 Bytes
/
Animal.hpp
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
//
// Created by Dominic Rutkowski on 2019-04-10.
//
#ifndef CS3210_COURSE_PROJECT_ANIMAL_HPP
#define CS3210_COURSE_PROJECT_ANIMAL_HPP
#include "Organism.hpp"
#include <vector>
namespace cs3210 {
enum class AnimalType {
HERBIVORE, OMNIVORE
};
class Animal : public Organism {
protected:
const AnimalType animalType;
const std::vector<std::string> foodChain;
bool moved;
bool reproduced;
public:
Animal(const std::string& symbol, const unsigned int maxEnergy, unsigned int energy, const AnimalType& animalType, const std::vector<std::string>& foodChain);
const std::vector<std::string>& getFoodChain() const;
void setMoved(bool moved = true);
void setReproduced(bool reproduced = true);
bool hasMoved() const;
bool hasReproduced() const;
std::string toString() const override;
AnimalType getAnimalType() const;
};
}
#endif //CS3210_COURSE_PROJECT_ANIMAL_HPP