segon commit

This commit is contained in:
2026-04-05 21:34:38 +02:00
parent d168ed59f9
commit 20ad7d778f
502 changed files with 178145 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#include "game/gameplay/room_tracker.hpp"
#include <algorithm> // Para std::ranges::any_of
// Comprueba si la habitación ya ha sido visitada
auto RoomTracker::hasBeenVisited(const std::string& name) -> bool { // NOLINT(readability-convert-member-functions-to-static)
return std::ranges::any_of(rooms_, [&name](const auto& l) -> bool { return l == name; });
}
// Añade la habitación a la lista
auto RoomTracker::addRoom(const std::string& name) -> bool { // NOLINT(readability-convert-member-functions-to-static)
// Comprueba si la habitación ya ha sido visitada
if (!hasBeenVisited(name)) {
// En caso contrario añádela a la lista
rooms_.push_back(name);
return true; // NOLINT(readability-simplify-boolean-expr)
}
return false;
}