From 3f07f307569afce65e0ed96499e344f8c2656198 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 9 Jun 2022 22:10:55 -0700 Subject: feat: initial commit --- src/Mammal.cc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/Mammal.cc (limited to 'src/Mammal.cc') 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 + +#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 -- cgit v1.2.3