Better handling of filling empty slots.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-12-07 12:13:12 +01:00
parent 345af31464
commit 57f16bc420
10 changed files with 80 additions and 31 deletions

View File

@@ -7,6 +7,17 @@ using namespace CreatureLib::Battling;
bool BattleSide::AllChoicesSet() const { return _choicesSet == _creaturesPerSide; }
bool BattleSide::AllPossibleSlotsFilled() const {
for (size_t i = 0; i < _creatures.size(); i++) {
auto c = _creatures[i];
if (c == nullptr || c->IsFainted()) {
if (_battle->CanSlotBeFilled(_index, i))
return false;
}
}
return true;
}
void BattleSide::ResetChoices() {
_choicesSet = 0;
for (uint8_t i = 0; i < _creaturesPerSide; i++) {