#pragma once #include "List.h" #include "ListIterator.h" class Enemy; class Object; enum Direction { NORTH = 0, EAST = 1, SOUTH = 2, WEST = 3, }; static constexpr const Direction DIRECTIONS[] = { NORTH, EAST, SOUTH, WEST }; class Location { public: void set_name(const char * name); const char * get_name(); void set_description(const char * description); const char * get_description(); void set_exit(Direction dir, Location * location = nullptr); Location * get_exit(Direction dir); void add_object(Object *); void remove_object(Object *); ListRange get_objects(); void add_enemy(Enemy *); ListRange get_enemies(); private: friend class LocationFactory; Location(const char * name = "", const char * description = ""); public: virtual ~Location(); private: const char * name = nullptr; const char * description = nullptr; List enemies = {}; List objects = {}; Location * edges[4] = { nullptr, nullptr, nullptr, nullptr, }; };