refactor: tornar std::ranges::{any,all,find}_of a bucles for explícits
This commit is contained in:
@@ -225,13 +225,21 @@ namespace Title {
|
||||
}
|
||||
|
||||
auto ShipAnimator::isVisible() const -> bool {
|
||||
return std::ranges::any_of(ships_,
|
||||
[](const TitleShip& s) { return s.visible; });
|
||||
for (const auto& s : ships_) {
|
||||
if (s.visible) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
auto ShipAnimator::isAnimationComplete() const -> bool {
|
||||
return std::ranges::all_of(ships_,
|
||||
[](const TitleShip& s) { return !s.visible; });
|
||||
for (const auto& s : ships_) {
|
||||
if (s.visible) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void ShipAnimator::updateEntering(TitleShip& ship, float delta_time) {
|
||||
|
||||
Reference in New Issue
Block a user