Battlefield.hpp
Go to the documentation of this file.
1 // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon
2 
3 // We are making my contributions/submissions to this project solely in our
4 // personal capacity and are not conveying any rights to any intellectual
5 // property of any third parties.
6 
7 #ifndef ROSETTASTONE_BATTLEFIELD_HPP
8 #define ROSETTASTONE_BATTLEFIELD_HPP
9 
13 
14 #include <array>
15 
16 namespace RosettaStone
17 {
30 {
31  public:
33  Battlefield();
34 
37  Player& GetOwner() const;
38 
41  void SetOwner(Player& owner);
42 
45  std::size_t GetNumOfMinions() const;
46 
50  Character* GetMinion(std::size_t pos);
51 
54  std::vector<Character*> GetAllMinions();
55 
58  std::optional<std::size_t> FindMinionPos(Minion& minion);
59 
62  std::optional<std::size_t> FindEmptyPos() const;
63 
67  void AddMinion(Minion& minion, std::size_t pos);
68 
71  void RemoveMinion(Minion& minion);
72 
73  private:
74  Player* m_owner = nullptr;
75 
76  std::array<Character*, FIELD_SIZE> m_minions{};
77 };
78 } // namespace RosettaStone
79 
80 #endif // ROSETTASTONE_BATTLEFIELD_HPP
std::optional< std::size_t > FindMinionPos(Minion &minion)
std::optional< std::size_t > FindEmptyPos() const
std::vector< Character * > GetAllMinions()
Character * GetMinion(std::size_t pos)
Minion class.
Definition: Minion.hpp:19
Battlefield()
Default constructor.
std::size_t GetNumOfMinions() const
void AddMinion(Minion &minion, std::size_t pos)
Battlefield class.
Definition: Battlefield.hpp:29
Player & GetOwner() const
Player class.
Definition: Player.hpp:33
Definition: AccountInfo.hpp:14
void SetOwner(Player &owner)
void RemoveMinion(Minion &minion)
Abstract character class that stores hero and minion data.
Definition: Character.hpp:21