forked from jaildesigner-jailgames/jaildoctors_dilemma
Arreglos en la estructura i format del codi
This commit is contained in:
@@ -1,20 +1,9 @@
|
||||
#include "room_tracker.h"
|
||||
|
||||
// Constructor
|
||||
RoomTracker::RoomTracker()
|
||||
{
|
||||
}
|
||||
|
||||
// Destructor
|
||||
RoomTracker::~RoomTracker()
|
||||
{
|
||||
list.clear();
|
||||
}
|
||||
|
||||
// Comprueba si la habitación ya ha sido visitada
|
||||
bool RoomTracker::hasBeenVisited(std::string name)
|
||||
bool RoomTracker::hasBeenVisited(const std::string &name)
|
||||
{
|
||||
for (auto l : list)
|
||||
for (const auto &l : list)
|
||||
{
|
||||
if (l == name)
|
||||
{
|
||||
@@ -26,7 +15,7 @@ bool RoomTracker::hasBeenVisited(std::string name)
|
||||
}
|
||||
|
||||
// Añade la habitación a la lista
|
||||
bool RoomTracker::addRoom(std::string name)
|
||||
bool RoomTracker::addRoom(const std::string &name)
|
||||
{
|
||||
// Comprueba si la habitación ya ha sido visitada
|
||||
if (!hasBeenVisited(name))
|
||||
|
||||
Reference in New Issue
Block a user