refactor: tornar std::ranges::{any,all,find}_of a bucles for explícits
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -56,9 +55,12 @@ namespace StageSystem {
|
||||
if (stage_id == 0 || waves.empty()) {
|
||||
return false;
|
||||
}
|
||||
return std::ranges::all_of(waves, [](const WaveConfig& w) {
|
||||
return w.next.isValid() && !w.spawn.empty();
|
||||
});
|
||||
for (const auto& w : waves) {
|
||||
if (!w.next.isValid() || w.spawn.empty()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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