Use algorithm for IsResponsibleForIndex check.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
69f6a89c0d
commit
18203138d1
|
@ -19,3 +19,9 @@ export uint8_t CreatureLib_BattleParty_IsResponsibleForIndex(bool& out, const Ba
|
||||||
}
|
}
|
||||||
|
|
||||||
export bool CreatureLib_BattleParty_HasCreaturesNotInField(const BattleParty* p) { return p->HasCreaturesNotInField(); }
|
export bool CreatureLib_BattleParty_HasCreaturesNotInField(const BattleParty* p) { return p->HasCreaturesNotInField(); }
|
||||||
|
|
||||||
|
inline bool BattleParty::IsResponsibleForIndex(uint8_t side, uint8_t index) const {
|
||||||
|
return std::any_of(_responsibleIndices.begin(), _responsibleIndices.end(), [side, index](const CreatureIndex& ci) {
|
||||||
|
return ci.GetSideIndex() == side && ci.GetCreatureIndex() == index;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
@ -24,13 +24,7 @@ namespace CreatureLib::Battling {
|
||||||
return _responsibleIndices.Contains(index);
|
return _responsibleIndices.Contains(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool IsResponsibleForIndex(uint8_t side, uint8_t index) const {
|
bool IsResponsibleForIndex(uint8_t side, uint8_t index) const;
|
||||||
for (const auto& i : _responsibleIndices) {
|
|
||||||
if (i.GetSideIndex() == side && i.GetCreatureIndex() == index)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool HasCreaturesNotInField() const {
|
inline bool HasCreaturesNotInField() const {
|
||||||
auto& p = _party->GetParty();
|
auto& p = _party->GetParty();
|
||||||
|
|
Loading…
Reference in New Issue