Rework for BattleSide to use std::vector<bool> to deal with some edge cases
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
acf6612eba
commit
24f18c775d
|
@ -10,7 +10,7 @@ namespace CreatureLib::Battling {
|
|||
u8 _creaturesPerSide;
|
||||
ArbUt::List<ArbUt::OptionalBorrowedPtr<Creature>> _creatures;
|
||||
ArbUt::List<std::shared_ptr<BaseTurnChoice>> _choices;
|
||||
ArbUt::List<bool> _fillableSlots;
|
||||
std::vector<bool> _fillableSlots;
|
||||
u8 _choicesSet = 0;
|
||||
ScriptSet _volatile;
|
||||
ArbUt::BorrowedPtr<Battle> _battle;
|
||||
|
@ -23,7 +23,7 @@ namespace CreatureLib::Battling {
|
|||
for (size_t i = 0; i < creaturesPerSide; i++) {
|
||||
_creatures.Append(nullptr);
|
||||
_choices.Append(nullptr);
|
||||
_fillableSlots.Append(true);
|
||||
_fillableSlots[i] = true;
|
||||
}
|
||||
ResetChoices();
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ namespace CreatureLib::Battling {
|
|||
if (!_creatures[i].HasValue())
|
||||
continue;
|
||||
if (_creatures[i].GetValue() == creature) {
|
||||
_fillableSlots.At(i) = false;
|
||||
_fillableSlots.at(i) = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ namespace CreatureLib::Battling {
|
|||
if (!_creatures[i].HasValue())
|
||||
continue;
|
||||
if (_creatures[i].GetValue() == creature) {
|
||||
return _fillableSlots.At(i);
|
||||
return _fillableSlots.at(i);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue