#pragma once
#include <windows.h>
#include "C:\L\Map\IsoHexTile.h"

/*
	Setting up some definitive window sizes.
	These really should be in the specific game(s) themselves 
	so that each project will not impede upon anothers
*/
#define	_ViewSqrW		17
#define	_ViewSqrH		17

#define _ViewSqrIsoW	17
#define _ViewSqrIsoH	33

#define	_ViewIsoW		19
#define	_ViewIsoH		65

#define	_ViewHexW		11
#define	_ViewHexH		37

//Enumerate map mode...this is generic to each game
enum MapModes { SQR_Map = 0, DIA_Map, RHO_Map, HEX_Map, TOTAL_MAP_TYPES };

//A point in two-dimensional space
struct MyPoint
{
	int x, y;
};

class PlayWindow
{
public:
	PlayWindow();
	~PlayWindow();

	//Use this to set up initially...
	void		SetBasics(int x, int y, int w, int h, int type);	//Initializes all base variables
	void		Move(int x, int y);									//Moves the view to the top left x,y coordinate
	void		CalcModifications();								//Once is either Int'd or Moved, needs to be done (Auto)

	//Use these only as Maintainence for the Class-PlayWindow
	void		SetOriginX		(int data);
	int			GetOriginX		() const;
	void		SetOriginY		(int data);
	int			GetOriginY		() const;
	void		SetWidth		(int data);
	int			GetWidth		() const;
	void		SetHeight		(int data);
	int			GetHeight		() const;

	int			GetCenterX		() const;
	int			GetCenterY		() const;

	void		SetType			(int data);
	int			GetType			() const;

	int			GetTileW		() const;
	int			GetTileH		() const;
	int			GetTileOffX		() const;
	int			GetTileOffY		() const;
	int			GetScrnW		() const;
	int			GetScrnH		() const;
	int			GetCentTileX	() const;
	int			GetCentTileY	() const;

	//Get the coordinates of the screen window
	int			gRectL			() { return scrnRect.left;		};
	int			gRectR			() { return scrnRect.right;		};
	int			gRectT			() { return scrnRect.top;		};
	int			gRectB			() { return scrnRect.bottom;	};
	RECT		GetRect			() const { return scrnRect;		};

private:
	MyPoint		Origin;			//Where is the top left?
	RECT		scrnRect;		//Pre-calculated RECT
	int			Width;			//How wide in pixels?
	int			Height;			//How high in pixels?
	int			CenterX;		//Middle of screen (pixel point)
	int			CenterY;		//Middle of screen (pixel point)
	int			ScrnType;		//Square, SqrIso-, Iso-, Hex- map?

	//Square map data--------------------------------------------------------------------
public:
	void		SetSqrTileW		(int data);
	int			GetSqrTileW		() const;
	void		SetSqrTileH		(int data);
	int			GetSqrTileH		() const;
	void		SetSqrData(int TileW, int TileH, int ScrnW, int ScrnH);

	IsoHexTile	SqrScrn[_ViewSqrW][_ViewSqrH];

private:
	int			SqrTileW;		//Width of Pixels...
	int			SqrTileH;		//Height of Pixels...
	int			SqrScrnW;		//Columns...
	int			SqrScrnH;		//Rows...
	int			SqrOffX;		//An offset
	int			SqrOffY;		//An offset
	int			SqrCentX;		//A mid-point Tile
	int			SqrCentY;		//A mid-point Tile

	//SqrIsoMap data---------------------------------------------------------------------
public:
	void		SetSqrIsoTileW	(int data);
	int			GetSqrIsoTileW	() const;
	void		SetSqrIsoTileH	(int data);
	int			GetSqrIsoTileH	() const;
	void		SetSqrIsoData(int TileW, int TileH, int ScrnW, int ScrnH);

	IsoHexTile	SqrIsoScrn[_ViewSqrIsoW][_ViewSqrIsoH];

private:
	int			SqrIsoTileW;
	int			SqrIsoTileH;
	int			SqrIsoScrnW;
	int			SqrIsoScrnH;
	int			SqrIsoOffX;
	int			SqrIsoOffY;
	int			SqrIsoCentX;
	int			SqrIsoCentY;

	//Iso- map data----------------------------------------------------------------------
public:
	void		SetIsoTileW		(int data);
	void		SetIsoTileH		(int data);
	void		SetIsoScrnW		(int data);
	void		SetIsoScrnH		(int data);
	void		SetIsoData(int TileW, int TileH, int ScrnW, int ScrnH);

	IsoHexTile	IsoScrn[_ViewIsoW][_ViewIsoH];

private:
	int			IsoTileW;		//Width of Pixels...
	int			IsoTileH;		//Height of Pixels...
	int			IsoScrnW;		//Columns...
	int			IsoScrnH;		//Rows...
	int			IsoOffX;		//An offset
	int			IsoOffY;		//An offset
	int			IsoCentX;		//A mid-point Tile
	int			IsoCentY;		//A mid-point Tile

	//Hex- map data----------------------------------------------------------------------
public:
	void		SetHexTileW		(int data);
	void		SetHexTileH		(int data);
	void		SetHexScrnW		(int data);
	void		SetHexScrnH		(int data);
	void		SetHexData(int TileW, int TileH, int ScrnW, int ScrnH);

	IsoHexTile	HexScrn[_ViewHexW][_ViewHexH];

private:
	int			HexTileW;		//Width of Pixels...
	int			HexTileH;		//Height of Pixels...
	int			HexScrnW;		//Columns...
	int			HexScrnH;		//Rows...
	int			HexOffX;		//An offset
	int			HexOffY;		//An offset
	int			HexCentX;		//A mid-point Tile
	int			HexCentY;		//A mid-point Tile
};