diff options
Diffstat (limited to 'src/ZooAnimal.hh')
| -rw-r--r-- | src/ZooAnimal.hh | 72 |
1 files changed, 72 insertions, 0 deletions
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 <string> +#include <utility> + +#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 |