Au, a casa

This commit is contained in:
2024-10-22 13:56:50 +02:00
parent 5df85e1b1a
commit 528533fd9b
8 changed files with 40 additions and 54 deletions
+3 -6
View File
@@ -35,10 +35,7 @@ void ManageHiScoreTable::add(HiScoreEntry entry)
sort();
// Deja solo las 10 primeras entradas
if (static_cast<int>(table_.size()) > 10)
{
table_.resize(10);
}
table_.resize(10);
}
// Ordena la tabla
@@ -47,9 +44,9 @@ void ManageHiScoreTable::sort()
struct
{
bool operator()(const HiScoreEntry &a, const HiScoreEntry &b) const { return a.score > b.score; }
} custom_less;
} scoreDescendingComparator;
std::sort(table_.begin(), table_.end(), custom_less);
std::sort(table_.begin(), table_.end(), scoreDescendingComparator);
}
// Carga la tabla con los datos de un fichero