Use std::algorithm for Battle::CreatureInField
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
57e8595bdf
commit
44de4a0799
|
@ -75,11 +75,7 @@ BattleRandom* Battle::GetRandom() noexcept { return &_random; }
|
||||||
|
|
||||||
bool Battle::CreatureInField(ArbUt::BorrowedPtr<Creature> creature) const {
|
bool Battle::CreatureInField(ArbUt::BorrowedPtr<Creature> creature) const {
|
||||||
AssertNotNull(creature)
|
AssertNotNull(creature)
|
||||||
for (auto s : _sides) {
|
return std::any_of(_sides.begin(), _sides.end(), [creature](auto c) { return c->CreatureOnSide(creature); });
|
||||||
if (s->CreatureOnSide(creature))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Battle::ForceRecall(uint8_t side, uint8_t index) { _sides[side]->SetCreature(nullptr, index); }
|
void Battle::ForceRecall(uint8_t side, uint8_t index) { _sides[side]->SetCreature(nullptr, index); }
|
||||||
|
|
Loading…
Reference in New Issue