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/ZooAnimal.hh | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/ZooAnimal.hh (limited to 'src/ZooAnimal.hh') diff --git a/src/ZooAnimal.hh b/src/ZooAnimal.hh new file mode 100644 index 0000000..853fd5d --- /dev/null +++ b/src/ZooAnimal.hh @@ -0,0 +1,72 @@ +#ifndef ZOO_ANIMAL +#define ZOO_ANIMAL + +#include +#include + +#include "Zoo.hh" + +namespace zoo { +/** + * @brief Used to store the identification number, cage number where the animal + * is kept, species of animal, and date of acquisition + */ +class ZooAnimal { +private: + int idNumber; + int cageNumber; + int dateAcquired; + [[maybe_unused]] int padding; + std::string species; + Zoo *zoo; + +public: + explicit ZooAnimal(int _idNumber = 0, int _cageNumber = 0, + int _dateAcquired = 0, std::string _species = "", + Zoo *_zoo = nullptr) + : idNumber(_idNumber), cageNumber(_cageNumber), + dateAcquired(_dateAcquired), padding(0), species(std::move(_species)), + zoo(_zoo) {} + + virtual ~ZooAnimal(); + + /** + * @brief Set the ID number of a zoo animal + */ + void setIDNum(int); + /** + * @brief Set the cage number of a zoo animal + */ + void setCageNum(int); + /** + * @brief Set the date of acquisition of a zoo animal + */ + void setDateAcq(int); + /** + * @brief Set the species of a zoo animal + */ + void setSpecies(std::string); + + /** + * @brief Get the ID number of a zoo animal + */ + [[nodiscard]] int getIDNum() const; + /** + * @brief Get the cage number of a zoo animal + */ + [[nodiscard]] int getCageNum() const; + /** + * @brief Get the date of acquisition of a zoo animal + */ + [[nodiscard]] int getDateAcq() const; + /** + * @brief Get the species of a zoo animal + */ + std::string getSpecies(); + +private: + bool validateCageNumber(int); +}; +} // namespace zoo + +#endif // ZOO_ANIMAL -- cgit v1.2.3