diff options
| author | Fuwn <[email protected]> | 2022-06-09 22:10:55 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-06-09 22:10:55 -0700 |
| commit | 3f07f307569afce65e0ed96499e344f8c2656198 (patch) | |
| tree | 0a8938ebd967d575678ddd3c83c206074331ca2b /src/Mammal.cc | |
| download | zoo-main.tar.xz zoo-main.zip | |
Diffstat (limited to 'src/Mammal.cc')
| -rw-r--r-- | src/Mammal.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/Mammal.cc b/src/Mammal.cc new file mode 100644 index 0000000..2763fcc --- /dev/null +++ b/src/Mammal.cc @@ -0,0 +1,33 @@ +#include <utility> + +#include "Mammal.hh" + +namespace zoo { +Mammal::~Mammal() = default; + +void Mammal::setExhibit(std::string _exhibit) { + this->exhibit = std::move(_exhibit); +} + +void Mammal::setName(std::string _name) { this->name = std::move(_name); } + +void Mammal::setCageSizeMin(int _cageSizeMin) { + if (Mammal::validateCageSizeMin(_cageSizeMin)) { + this->cageSizeMin = _cageSizeMin; + } +} + +std::string Mammal::getExhibit() { return this->exhibit; } + +std::string Mammal::getName() { return this->name; } + +int Mammal::getCageSizeMin() const { return this->cageSizeMin; } + +bool Mammal::validateCageSizeMin(int cageSize) { + if (cageSize < 2 || cageSize > 100000) { + return false; + } else { + return true; + } +} +} // namespace zoo |