Add support for swapping in and out of a party.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-07-25 14:35:13 +02:00
parent 3f447a3e16
commit 8f921ce89b
2 changed files with 10 additions and 0 deletions

View File

@@ -23,6 +23,12 @@ namespace CreatureLib::Battling {
_party[b] = ca;
}
Creature* SwapInto(size_t index, Creature* creature) {
auto p = _party.TakeOwnership(index);
_party.Set(index, creature);
return p;
}
bool HasAvailableCreatures() const noexcept {
for (Creature* c : _party) {
if (c == nullptr)