public int StartGame(IAgent[] agents, int boardSeed, int diceSeed, bool visual, bool logToFile)
{
this.visual = visual;
this.logToFile = logToFile;
//Initialize random number generators
diceRandom = new Random(diceSeed);
shuffleRandom = new Random(boardSeed); //The card deck is based on the seed of the board
//Build player list
players = new Player[agents.Length];
for (int i = 0; i < agents.Length; i++)
{
players[i] = new Player(agents[i], i);
}
//Set up board
board = new Board(boardSeed);
PopulateDevelopmentCardStack();
resourceBank = new int[] { 19, 19, 19, 19, 19 };
//Start the game!
turn = 0;
//StartGUI();
if (visual)
{
Thread guiThread = new Thread(StartGUI);
guiThread.Start();
Thread.Sleep(5000);
}
PlaceStarts();
int result = GameLoop();
if (logToFile) System.IO.File.WriteAllLines(DateTime.Now.ToString("s").Replace(":","").Replace("-","")+" GameLog.txt", log.Select(l => l.ToString()));
return result;
}