/*
*	shell.cpp
*	----------------------------------------
*	A part of "Intelligent AI"
*	© 2001 SCC Team 064
*	----------------------------------------
*
*	This file:
*		€ Produces a text-based interface for the User.
*		€ Accepts input from the User and transfers this input to storing functions
*		   ( resident in store-retrieve.cp ).
*		€ Logs all interface input to a log file (if this preference is enabled
*		   by the User).
*/

#include "Project.h"


/*					Initial User Interface				*/
void initialInterface()
{
	char choseAI;
	bool retry;
	int screenShot;
	int numAIs;

	cout << "SCC Team 064 \n";
	cout << "Welcome to the Intelligent AI Predator simulation \n";
	cout << "Scott Richardson and Joseph Farfel \n \n";

	cout << "How many players do you want in the simulation? (Must Be Two) \n";
	cin >> numAIs;

	while (numAIs != 2)
	{
		if (numAIs > MAX_PLAYERS || numAIs <= 1)
		{
			cout << "Number of Players must Be Two \n";
			cin >> numAIs;
		}
	}

	storeCurrentNumPlayers(numAIs);

	for (int i = 0; i < numAIs; i++)
	{
		do
		{
			cout << "Enter which AI you would like for player " << i << " (constantAI - c 
				or evolvingAI - e): ";
			cin >> choseAI;

			switch (choseAI)
			{
				case 'c':
				case 'C':					storeAIType(i, constantAI);
											retry = false;											
											break;
				case 'e':
				case 'E':					storeAIType(i, evolvingAI);
											retry = false;
											break;
				case 'h':
				case 'H':
											storeAIType(i, humanAI);
											retry = false;
											break;

				default:					cout << "You did not make valid choices, please 
												chose again. \n";
											retry = true;
											break;
			}
		}while (retry);
	}
}


/*					Final User Inteface				*/
//The code moves players down the stack unitll there is only one
//remaining player, the VICTOR
void exitInterface(unsigned long cycleCounter)
{
	char exit;

	cout << "Player " << player[0].whichPlayer << " was the victor \n";
	cout << "The simulation ran " << cycleCounter << "cycles \n";
	cout << "Thank You for entertaining this simulation \n \n";
	cout << "This simulation will now be run again.";
	cin >> exit;
}