Implemented and fixed all code required to run at least a single turn.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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; }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user