#include #include "Location.h" #include "ListIterator.h" #include "util.h" Location::Location(const char * name, const char * description) { this->set_name(name); this->set_description(description); } Location::~Location() { safe_free(this->name); safe_free(this->description); } void Location::set_name(const char * name) { safe_free(this->name); this->name = strdup(name); } const char * Location::get_name() { return this->name; } void Location::set_description(const char * description) { safe_free(this->description); this->description = strdup(description); } const char * Location::get_description() { return this->description; } void Location::set_exit(Direction dir, Location * location) { this->edges[dir] = location; } Location * Location::get_exit(Direction dir) { return this->edges[dir]; } ListRange Location::get_objects() { return this->objects.range(); }