#include <iostream>
#include <string>
#include <vector>
#include "Map.h"

using namespace std;




/**************************************************************************


MAP


***************************************************************************/


Map::Map() {
	Room* p1 = new Room("Bedoom",
		"\nYou see a bed against the northern wall.\n\tThere is a door to the Kitchen to the east.\n\n",
		{ "SLATE" });
	Room* p2 = new Room("Kitchen",
		"\nYou see a table in the middle of the room, and a brick stove north western wall.\n\tA door leads to the west.\n\tStairs to the south lead to the Commoner's Well.\n\n",
		{ "KNIFE" });
	Room* p3 = new Room("Commoner's Well",
		"\nThere is a well in an open area surrounded by other residential housing.\n\tYour home is to the north.\n\tTo the west lies your Workshop.\n\n",
		{ "BUCKET" });
	Room* p4 = new Room("Myne's Workshop",
		"\nA small wooden building that is no bigger than a shed.\n\tThe residential area lies to the east.\n\tThe main road leads to the west.\n\n",
		{ "POT", "BOARD" });
	Room* p5 = new Room("Craftsmen's Alley",
		"\nA dark alley crowded with work buildings and many workers moving between buildings.\n\tTo the east is your workshop.\n\tTo the north is the merchant's district.\n\tTo the south is a gate and forests.\n\n",
		{});
	Room* p6 = new Room("South Gate",
		"\nA large opening in the outer wall of the city of Ehrenfest, with two large wooden doors.\n\tTo the north lies the main road.\n\tTo the south is the bridge to Hasse.\n\tTo the east is the forest where you can gather stuff.\n\n",
		{});
	Room* p7 = new Room("Bridge",
		"\nA stone bridge that goes over the river, this road leads to Hasse.\n\tYou cannot go past the bridge to Hasse.\n\tNorth leads back to the South Gate.\n\n",
		{});
	Room* p8 = new Room("Forest",
		"\nA large area of forest to which children travel to gather food and firewood.\n\tTo the west is the South Gate.\n\tThe river, a source of water, lies to the south.\n\n",
		{ "BRANCHES", "MUSHROOMS" });
	Room* p9 = new Room("River",
		"\nA small river that runs along the edge of the forest that has clean water.\n\tThe river water is too fast for you to cross.\n\tThe forest lies to your north.\n\n",
		{});
	Room* p10 = new Room("Central Plaze",
		"\nThis is the Central Plaze of Ehrenfest with a large fountain in the center, this is the beginning of the shopping district.\n\tTo the south are small businesses and houses.\n\tTo the north are merchant businesses and the temple.\n\tTo the west is the West Gate.\n\tTo the east is the East Gate.\n\n",
		{});
	Room* p11 = new Room("West Gate",
		"\nA large opening in the outer wall of the city of Ehrenfest, with two large wooden doors. A river and docks lie just outside the gate.\n\tA large river sits to the west, you cannot go any further.\n\tTo the east is the Central Plaza.\n\n",
		{});
	Room* p12 = new Room("East Gate",
		"\nA large opening in the outer wall of the city of Ehrenfest, with two large wooden doors. This leads to the main road for travelling merchants.\n\tA road north leads to the North Gate.\n\tTo the west lies the Central Plaza.\n\tThe guards don't know you and won't let you back in through this gate.\n\n",
		{});
	Room* p13 = new Room("Gilberta Company",
		"\nA large store specializing in women's clothing and accouterments. The store is filled with employees and customers.\n\tTo the south is the central plaza.\n\tTo the north is the Guild Master's store.\n\tTo the east is Benno Gilberta's offices.\n\n",
		{});
	Room* p14 = new Room("Benno's Office",
		"\nA small side office for the store's manager. A table with four chairs is in the center of the room and a desk is on the northern wall.\n\tThe only way out of the office is through the western doors.\n\n",
		{});
	Room* p15 = new Room("Othmar Company",
		"\nA more prestigious store than the Gilberta Company and the home of the Merchant Guildmaster of Ehrenfest.\n\tYou can see Benno's store to the south.\n\tTo the north, the Temple imposes it's greatness upon you.\n\n",
		{ "POUNDCAKE" });
	Room* p16 = new Room("Temple Gate",
		"\nThis gate has no doors, but leads to the temple, only baptized children and adults can pass.\n\tTo the south lies all of the town.\n\tYou can reach the Noble's district through the North gate to your east.\n\n",
		{});
	Room* p17 = new Room("North Gate",
		"\nLarge Ornate and Steel doors open north to the Noble's District. Only those with permission can pass.\n\tThe Temple Gate lies to your west.\n\tTo the south is the East Gate.\n\n",
		{});

	mStart = p1;

	// Locations with accessible directions
	p1->pEast = p2;
	p2->pSouth = p3; p2->pWest = p1;
	p3->pNorth = p2; p3->pWest = p4;
	p4->pEast = p3; p4->pWest = p5;
	p5->pNorth = p10; p5->pEast = p4; p5->pSouth = p6;
	p6->pNorth = p5; p6->pEast = p8; p6->pSouth = p7;
	p7->pNorth = p6;
	p8->pSouth = p9; p8->pWest = p6;
	p9->pNorth = p8;
	p10->pNorth = p13; p10->pEast = p12; p10->pSouth = p5; p10->pWest = p11;
	p11->pEast = p10;
	p12->pNorth = p17; p12->pWest = p10;
	p13->pNorth = p15; p13->pEast = p14; p13->pSouth = p10;
	p14->pWest = p13;
	p15->pNorth = p16; p15->pSouth = p13;
	p16->pEast = p17; p16->pSouth = p15;
	p17->pSouth = p12; p17->pWest = p16;
};

Map::~Map() {
	delete mStart->pNorth;
	delete mStart->pEast;
	delete mStart->pSouth;
	delete mStart->pWest;
}