summaryrefslogtreecommitdiff
path: root/src/Mammal.hh
blob: 12b3bcbecef615fa672d472185310c228a8c4f29 (plain) (blame)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef MAMMAL
#define MAMMAL

#include <utility>

#include "ZooAnimal.hh"

namespace zoo {
/**
 * @brief Used to store the name, location, and minimum cage size for a mammal
 */
class Mammal final : public ZooAnimal {
private:
  std::string exhibit;
  std::string name;
  int cageSizeMin;
  [[maybe_unused]] int padding;

public:
  explicit Mammal(std::string _exhibit = "", std::string _name = "",
                  int _cageSizeMin = 0, int _idNumber = 0, int _cageNumber = 0,
                  int _dateAcquired = 0, std::string _species = "",
                  Zoo *_zoo = nullptr)
      : ZooAnimal(_idNumber, _cageNumber, _dateAcquired, std::move(_species),
                  _zoo),
        exhibit(std::move(_exhibit)), name(std::move(_name)),
        cageSizeMin(_cageSizeMin), padding(0) {}

  ~Mammal() override;

  /**
   * @brief Set the exhibit of a mammal
   */
  void setExhibit(std::string);
  /**
   * @brief Set the name of a mammal
   */
  void setName(std::string);
  /**
   * @brief Set the cage size of a mammal
   */
  void setCageSizeMin(int);

  /**
   * @brief Get the exhibit of a mammal
   */
  std::string getExhibit();
  /**
   * @brief Get the name of a mammal
   */
  std::string getName();
  /**
   * @brief Get the cage size of a mammal
   */
  [[nodiscard]] int getCageSizeMin() const;

private:
  static bool validateCageSizeMin(int);
};
} // namespace zoo

#endif // MAMMAL