Replace most collections with Arbutils collections for more safety.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-03-22 19:21:40 +01:00
parent f190121e74
commit 27288563cd
40 changed files with 234 additions and 226 deletions

View File

@@ -9,7 +9,7 @@ bool BattleSide::AllChoicesSet() const { return _choicesSet == _creaturesPerSide
bool BattleSide::AllPossibleSlotsFilled() const {
AssertNotNull(_battle)
for (size_t i = 0; i < _creatures.size(); i++) {
for (size_t i = 0; i < _creatures.Count(); i++) {
auto c = _creatures[i];
if (c == nullptr || c->IsFainted()) {
if (_battle->CanSlotBeFilled(_index, i))
@@ -26,7 +26,7 @@ void BattleSide::ResetChoices() {
}
}
const std::vector<BaseTurnChoice*>& BattleSide::GetChoices() const { return _choices; }
const List<BaseTurnChoice*>& BattleSide::GetChoices() const { return _choices; }
void BattleSide::SetChoice(BaseTurnChoice* choice) {
AssertNotNull(choice)
@@ -68,8 +68,8 @@ bool BattleSide::CreatureOnSide(const Creature* creature) const {
Creature* BattleSide::GetCreature(uint8_t index) const { return _creatures[index]; }
void BattleSide::GetActiveScripts(std::vector<ScriptWrapper>& scripts) {
scripts.emplace_back(&_volatile);
void BattleSide::GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) {
scripts.Append(&_volatile);
_battle->GetActiveScripts(scripts);
}
uint8_t BattleSide::GetRandomCreatureIndex() {