summaryrefslogtreecommitdiff
path: root/src/Zoo.hh
blob: 4f4173b59ec0f5662524d402389d93aa1048fa6f (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
#ifndef ZOO
#define ZOO

#include <string>

namespace zoo {
/**
 * @brief Used to store the names of exhibits and cage numbers, in separate
 *        arrays
 */
class Zoo {
private:
  std::string *exhibits;
  int *cages;
  int numExhibits;
  int numCages;

public:
  Zoo()
      : exhibits(new std::string[0]()), cages(new int[0]()), numExhibits(0),
        numCages(0) {}

  ~Zoo();

  /**
   * @brief Add an exhibit to the zoo
   */
  void setExhibit(std::string);
  /**
   * @brief Add a cage to the zoo
   */
  void setCage(int);

  /**
   * @brief Get an exhibit's name from the zoo from its ID
   * @return An exhibit's name
   */
  std::string *getExhibit(std::size_t);
  /**
   * @brief Get a cage's ID from the zoo from its index
   * @return A cage's ID
   */
  int *getCage(std::size_t);
  /**
   * @brief Get the number of exhibits within the zoo
   * @return The number of exhibits within the Zoo
   */
  [[nodiscard]] int getNumExhibits() const;
  /**
   * @brief Get the number of cages within the zoo
   * @return The number of cages within the Zoo
   */
  [[nodiscard]] int getNumCages() const;

private:
  void incrementNumExhibits();
  void incrementNumCages();
};
} // namespace zoo

#endif // ZOO