Files
jaildoctors_dilemma/source/game/gameplay/room_tracker.cpp
2025-10-27 11:53:12 +01:00

24 lines
581 B
C++

#include "game/gameplay/room_tracker.hpp"
// Comprueba si la habitación ya ha sido visitada
bool RoomTracker::hasBeenVisited(const std::string& name) {
for (const auto& l : list_) {
if (l == name) {
return true;
}
}
return false;
}
// Añade la habitación a la lista
bool RoomTracker::addRoom(const std::string& name) {
// Comprueba si la habitación ya ha sido visitada
if (!hasBeenVisited(name)) {
// En caso contrario añádela a la lista
list_.push_back(name);
return true;
}
return false;
}