#pragma once
#include <windows.h>
#include <string>
#include <fstream>
#include <sstream>
using namespace std;
using std::string;
using std::istringstream;
#define MaxLinesSaved 300
struct myMsg
{
	int	Red; int Grn; int Blu;
	int Port; int Sex; int Who; //Used to open Menus
	int Class;
	string	sMsg;
};
class ChatWindow
{
public:
				ChatWindow		();
				ChatWindow		(int HowWide, int Height);
				ChatWindow		(int X, int Y, int HowWide, int Height);
				~ChatWindow		();
	void		Reset			();

	void		SetX			(int Data);
	int			GetX			() const;
	void		SetY			(int Data);
	int			GetY			() const;
	void		SetPos			(int DataX, int DataY);

	void		SetScrnWidth	(int numChars);
	int			GetScrnWidth	();
	void		SetNumDisLines	(int Lines);
	int			GetNumDisLines	();
	
	//Adjust the display values
	void		IncIndex		();
	void		DecIndex		();
	void		SetIndex		(int Percentage);

	void		AddMsg			(int ServIn, int dataRed, int dataGrn, int dataBlu, int Port, int dataSex, string dataString);
	void		AddMsg			(int ServIn, int dataRed, int dataGrn, int dataBlu, int Port, int dataSex, int dataClass, string dataString);
	void		AddMsg			(char *charMsg);

	int			GetLineIndex	();	//Where does the display start at?
	int			GetNumLines		();	//Where does the display stop at?

	//Get Independent data from the class so the game can render as it sees fit
	int			GetSex			(int index);
	int			GetPort			(int index);
	int			GetRed			(int index);
	int			GetGrn			(int index);
	int			GetBlu			(int index);
	string		GetChatLine		(int index);
	void		ClearScrn		();

	int			GetWhoIsIt		(int index);
	int			GetClass		(int index);

	int			GetTestX		() const;
	int			GetTestY		() const;
	int			GetTestR		() const;
	int			GetTestB		() const;

private:
	int			PosX;
	int			PosY;
	int			NumLinesUsed;			//Associated with MsgList
	int			NumDisLines;			//Allowed number of display lines
	int			LineIndex;				//Associated with Lines[]
	int			TestPortsX;				//Left of Portraits
	int			TestPortsY;				//Top of Portraits
	int			TestPortR;
	int			TestPortB;
	int			ScrnWidth;
	myMsg		Lines[MaxLinesSaved];	//Place to compile lines for display
};