This commit is contained in:
2025-11-07 17:58:47 +01:00
parent 6e3cd05cd2
commit 2c92fe8372
7 changed files with 18 additions and 27 deletions

View File

@@ -2,9 +2,10 @@
#include <SDL3/SDL.h>
#include <cstddef> // Para NULL
#include <fstream> // Para basic_ostream, operator<<, basic_ofstream
#include <iostream> // Para cout, cerr
#include <algorithm> // Para std::count_if
#include <cstddef> // Para NULL
#include <fstream> // Para basic_ostream, operator<<, basic_ofstream
#include <iostream> // Para cout, cerr
#include <utility>
#include "game/options.hpp" // Para Options, options
@@ -159,13 +160,8 @@ void Cheevos::saveToFile() {
// Devuelve el número total de logros desbloqueados
auto Cheevos::getTotalUnlockedAchievements() -> int {
int count = 0;
for (const auto& cheevo : cheevos_list_) {
if (cheevo.completed) {
count++;
}
}
return count;
return std::count_if(cheevos_list_.begin(), cheevos_list_.end(),
[](const auto& cheevo) { return cheevo.completed; });
}
// Elimina el estado "no obtenible"