forked from jaildesigner-jailgames/jaildoctors_dilemma
clang-format
clang-tidy (macos)
This commit is contained in:
@@ -40,7 +40,7 @@ void Stats::init()
|
||||
}
|
||||
|
||||
// Añade una muerte a las estadisticas
|
||||
void Stats::addDeath(const std::string& name) {
|
||||
void Stats::addDeath(const std::string& name) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
// Primero busca si ya hay una entrada con ese nombre
|
||||
const int INDEX = findByName(name, buffer_list_);
|
||||
if (INDEX != -1) {
|
||||
@@ -58,7 +58,7 @@ void Stats::addDeath(const std::string& name) {
|
||||
}
|
||||
|
||||
// Añade una visita a las estadisticas
|
||||
void Stats::addVisit(const std::string& name) {
|
||||
void Stats::addVisit(const std::string& name) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
// Primero busca si ya hay una entrada con ese nombre
|
||||
const int INDEX = findByName(name, buffer_list_);
|
||||
if (INDEX != -1) {
|
||||
@@ -76,7 +76,7 @@ void Stats::addVisit(const std::string& name) {
|
||||
}
|
||||
|
||||
// Busca una entrada en la lista por nombre
|
||||
auto Stats::findByName(const std::string& name, const std::vector<RoomData>& list) -> int {
|
||||
auto Stats::findByName(const std::string& name, const std::vector<RoomData>& list) -> int { // NOLINT(readability-convert-member-functions-to-static)
|
||||
int i = 0;
|
||||
|
||||
for (const auto& l : list) {
|
||||
@@ -90,7 +90,7 @@ auto Stats::findByName(const std::string& name, const std::vector<RoomData>& lis
|
||||
}
|
||||
|
||||
// Carga las estadisticas desde un fichero
|
||||
auto Stats::loadFromFile(const std::string& file_path, std::vector<RoomData>& list) -> bool {
|
||||
auto Stats::loadFromFile(const std::string& file_path, std::vector<RoomData>& list) -> bool { // NOLINT(readability-convert-member-functions-to-static)
|
||||
list.clear();
|
||||
|
||||
// Indicador de éxito en la carga
|
||||
@@ -109,7 +109,7 @@ auto Stats::loadFromFile(const std::string& file_path, std::vector<RoomData>& li
|
||||
line.pop_back();
|
||||
}
|
||||
// Comprueba que la linea no sea un comentario
|
||||
if (line.substr(0, 1) != "#") {
|
||||
if (!line.starts_with("#")) {
|
||||
RoomData stat;
|
||||
std::stringstream ss(line);
|
||||
std::string tmp;
|
||||
@@ -159,7 +159,7 @@ void Stats::saveToFile(const std::string& file_path, const std::vector<RoomData>
|
||||
}
|
||||
|
||||
// Calcula cual es la habitación con más muertes
|
||||
void Stats::checkWorstNightmare() {
|
||||
void Stats::checkWorstNightmare() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
int deaths = 0;
|
||||
for (const auto& item : list_) {
|
||||
if (item.died > deaths) {
|
||||
@@ -171,7 +171,7 @@ void Stats::checkWorstNightmare() {
|
||||
|
||||
// Añade una entrada al diccionario
|
||||
void Stats::addDictionary(const std::string& number, const std::string& name) {
|
||||
dictionary_.push_back({number, name});
|
||||
dictionary_.push_back({.number = number, .name = name});
|
||||
}
|
||||
|
||||
// Vuelca los datos del buffer en la lista de estadisticas
|
||||
|
||||
Reference in New Issue
Block a user