Implemented and fixed all code required to run at least a single turn.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-12-05 12:56:41 +01:00
parent 5d6ac316eb
commit 6f32d1245b
17 changed files with 171 additions and 58 deletions

View File

@@ -5,11 +5,18 @@
#include "Creature.hpp"
namespace CreatureLib::Battling {
template <int max> class CreatureParty {
std::array<Creature*, max> _party;
class CreatureParty {
std::vector<Creature*> _party;
public:
CreatureParty(std::array<Creature*, max> party) : _party(party) {}
CreatureParty(std::vector<Creature*> party) : _party(party) {}
CreatureParty(std::initializer_list<Creature*> party) : _party(party) {}
~CreatureParty() {
for (auto c : _party) {
delete c;
}
}
Creature* GetAtIndex(int index) const { return _party[index]; }
@@ -29,6 +36,8 @@ namespace CreatureLib::Battling {
}
return false;
}
std::vector<Creature*>& GetParty() { return _party; }
};
}