#pragma once
#include <windows.h>
#include <iostream>
#include <fstream>
#include <string>
#include "C:\L\List\List.h"
#include "C:\L\Button\Button.h"
using namespace std;
using std::string;
enum LinkingCommands
{
	lcWorld = 0, lcScene, lcContinue, lcCancel, lcSave, lcInternalLinks, lcOpen, lcContinueTwo, lcPaths, lcLinksLeft, lcLinksRight, MAX_LCs
};
enum LinkMapByDirection
{
	lmFocus = 0, lmWest, lmNorth, lmEast, lmSouth, MAX_LMs
};
struct InternalMapLink
{
	int exitX, exitY;				//Location of exit on the Map of Interest - M. White 8 June, 2019
	int destX, destY;				//Destination map's location of entry - M. White 8 June, 2019
	int DestMapType;				//World or Scene (0, 1);
	int	IsHidden;
	string DestinationMapName;		//File name of the destinamtion Map - M. White 8 June, 2019
	string NickName;
};
class MapLinks
{
public:
	MapLinks							();
	MapLinks							(RECT RectWithDimensions);
	MapLinks							(int Left, int Top, int Right, int Bottom);
	~MapLinks							();
	void	Reset						();
	void	ReuseCleanUp				();
	void	ResetLinks					();
	void	SetScreen					(RECT RectWithDimensions);
	void	SetScreen					(int Left, int Top, int Right, int Bottom);
	void	SetSideBarScreen			(RECT Zone, int HeightOfTxtBox);
	void	SetUserInput				(int HeightOfTxtBox);
	InternalMapLink	GetActiveLink		(int x, int y);

	//Allow outside functions to get information from this Class - M. White 8 June, 2019
	RECT	GetRectScreen				() const;
	RECT	GetRectPickName				() const;
	RECT	GetRectMapInterest			() const;
	RECT	GetRectWestMap				() const;
	RECT	GetRectNorthMap				() const;
	RECT	GetRectEastMap				() const;
	RECT	GetRectSouthMap				() const;

	RECT	GetRectOP_LinkIndex			() const;
	RECT	GetRectOP_OriginMapPrompt	() const;
	RECT	GetRectOP_MOI_Name			() const;
	RECT	GetRectOP_MOI_CoordPrompt	() const;
	RECT	GetRectOP_MOI_ExitX			() const;
	RECT	GetRectOP_MOI_ExitY			() const;
	RECT	GetRectOP_DM_Prompt			() const;
	RECT	GetRectIO_DestMapName		() const;
	RECT	GetRectOP_DestCoordPrompt	() const;
	RECT	GetRectOP_Dest_EnterX		() const;
	RECT	GetRectOP_Dest_EnterY		() const;
	RECT	GetRectOP_DestNickPrompt	() const;
	RECT	GetRectIO_DestNickName		() const;

	RECT	GetRectUserInputScrn		() const;
	RECT	GetRectUserTextBox			() const;

	RECT	GetRectHorClickRegion		() const;

	bool	HitRectIO_DestMapName		(int X, int Y) const;
	bool	HitRectIO_DestNickName		(int X, int Y) const;
	bool	HitRectHorClickRegion		(int X, int Y) const;

	//The "Hit-tests" check to see if the User targetted one of the various RECTs - M. White 9 June, 2019
	bool	HitMapOfInterest	(int X, int Y);
	bool	HitWestMap			(int X, int Y);
	bool	HitNorthMap			(int X, int Y);
	bool	HitEastMap			(int X, int Y);
	bool	HitSouthMap			(int X, int Y);

	void	SetStrMOI			(string FileName);//MOI == Map of Interest
	string	GetStrMOI			() const;

	void	SetStrMapWest		(string FileName);
	string	GetStrMapWest		() const;

	void	SetStrMapNorth		(string FileName);
	string	GetStrMapNorth		() const;

	void	SetStrMapEast		(string FileName);
	string	GetStrMapEast		() const;

	void	SetStrMapSouth		(string FileName);
	string	GetStrMapSouth		() const;

	void	SetTypeWorld		(bool data);
	bool	GetTypeInterWorld	() const;

	void	SetTypeWest			(bool data);
    bool	GetTypeWest			() const;

	void	SetTypeNorth		(bool data);
	bool	GetTypeNorth		() const;

	void	SetTypeEast			(bool data);
    bool	GetTypeEast			() const;

	void	SetTypeSouth		(bool data);
	bool	GetTypeSouth		() const;

	int			NumButtons;
	myButton	buttons[MAX_LCs];
	//This integer is for switch() or if-tests to know where the User is focused - M. White 9 June, 2019
	//-1 == Default, 0 == MapOfInterest, 1 == West, 2 == North, 3 == East, 4 == South
	int		WhichMapBeingPicked;
	List<InternalMapLink> inLinks;
	int		NumInternalLinks;
	int		CurIndex;
	bool	ShowIntLink;
	bool	ShowUserInput;

	int		BmpSourceX;
	int		BmpSourceY;

private:
	//These methods kept private for internal use only - M. White 8 June, 2019
	void	SetPickingScreen	(int Left, int Top, int Right, int Bottom);
	void	SetRectMapInterest	(int Left, int Top, int Right, int Bottom);
	void	SetRectWestMap		(int Left, int Top, int Right, int Bottom);
	void	SetRectNorthMap		(int Left, int Top, int Right, int Bottom);
	void	SetRectEastMap		(int Left, int Top, int Right, int Bottom);
	void	SetRectSouthMap		(int Left, int Top, int Right, int Bottom);

	void	CalculateRects		();

	//This rect is a copy of the Play Window - This gets assigned directly when the User clicks the button, and then
	//this Class automatically assigns the rest of the values - M. White 8 June, 2019
	RECT	rect_Screen;

	//This is a smaller screen that appears when the User is picking a name out of the list - M. White 9 June, 2019
	RECT	rect_PickingMapNameScreen;

	//These rect target area values get assigned when the user clicks on the button to start editing - M. White 8 June, 2019
	RECT	rect_MapOfInterest;			//This map is looking at other maps - M. White 8 June, 2019
	RECT	rect_WestMap;				//This map is to the west of MapOfInterest - M. White 8 June, 2019
	RECT	rect_NorthMap;				//This map is to the north of MapOfInterest - M. White 8 June, 2019
	RECT	rect_EastMap;				//This map is to the east of MapOfInterest - M. White 8 June, 2019
	RECT	rect_SouthMap;				//This map is to the south of MapOfInterest - M. White 8 June, 2019

	//Side Bar Display/Test RECTs (OP == Output, IO == Input/Output, MOI == Map of Interest, DM == Destination Map)
	RECT	rectOP_LinkIndex;
	RECT	rectOP_OriginMapPrompt;
	RECT	rectOP_MOI_Name;
	RECT	rectOP_MOI_CoordPrompt;
	RECT	rectOP_MOI_ExitX;
	RECT	rectOP_MOI_ExitY;
	RECT	rectOP_DM_Prompt;
	RECT	rectIO_DestMapName;
	RECT	rectOP_DestCoordPrompt;
	RECT	rectOP_Dest_EnterX;
	RECT	rectOP_Dest_EnterY;
	RECT	rectOP_DestNickPrompt;
	RECT	rectIO_DestNickName;

	//User Typing Input
	RECT	rectUserInputScrn;
	RECT	rectUserTextBox;

	RECT	rectHorClickRegion;			//This is used to quick jump through the Internal Link listing - M. White 16 June, 2019

	bool	mapOfInterestIsWorldMap;	//Need to know if the maps are World or Not - M. White 9 June, 2019
	bool	westMapIsWorldMap;
	bool	northMapIsWorldMap;
	bool	eastMapIsWorldMap;
	bool	southMapIsWorldMap;

	//Names of the Maps to open files - M. White 8 June, 2019
	string	strMapOfInterest;
	string	strWestMap;
	string	strNorthMap;
	string	strEastMap;
	string	strSouthMap;

	bool	ShowInstructions;
	int		InstructStage;
};