Au, a casa
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user