forked from jaildesigner-jailgames/jaildoctors_dilemma
clang-format
clang-tidy (macos)
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
Cheevos* Cheevos::cheevos = nullptr;
|
||||
|
||||
// [SINGLETON] Crearemos el objeto con esta función estática
|
||||
void Cheevos::init(const std::string& file) {
|
||||
void Cheevos::init(const std::string& file) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
Cheevos::cheevos = new Cheevos(file);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ Cheevos::~Cheevos() {
|
||||
}
|
||||
|
||||
// Inicializa los logros
|
||||
void Cheevos::init() {
|
||||
void Cheevos::init() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
cheevos_list_.clear();
|
||||
auto* loc = Locale::get();
|
||||
cheevos_list_.emplace_back(Achievement{.id = 1, .caption = loc->get("achievements.c1"), .description = loc->get("achievements.d1"), .icon = 2});
|
||||
@@ -61,7 +61,7 @@ void Cheevos::init() {
|
||||
}
|
||||
|
||||
// Busca un logro por id y devuelve el indice
|
||||
auto Cheevos::find(int id) -> int {
|
||||
auto Cheevos::find(int id) -> int { // NOLINT(readability-convert-member-functions-to-static)
|
||||
for (int i = 0; i < (int)cheevos_list_.size(); ++i) {
|
||||
if (cheevos_list_[i].id == id) {
|
||||
return i;
|
||||
@@ -101,7 +101,7 @@ void Cheevos::setUnobtainable(int id) {
|
||||
}
|
||||
|
||||
// Carga el estado de los logros desde un fichero
|
||||
void Cheevos::loadFromFile() {
|
||||
void Cheevos::loadFromFile() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
std::ifstream file(file_, std::ios::binary);
|
||||
|
||||
// El fichero no existe
|
||||
@@ -162,7 +162,7 @@ void Cheevos::saveToFile() {
|
||||
|
||||
// Devuelve el número total de logros desbloqueados
|
||||
auto Cheevos::getTotalUnlockedAchievements() -> int {
|
||||
return std::count_if(cheevos_list_.begin(), cheevos_list_.end(), [](const auto& cheevo) { return cheevo.completed; });
|
||||
return std::count_if(cheevos_list_.begin(), cheevos_list_.end(), [](const auto& cheevo) -> bool { return cheevo.completed; });
|
||||
}
|
||||
|
||||
// Elimina el estado "no obtenible"
|
||||
|
||||
Reference in New Issue
Block a user