/// <summary> /// In this method AI makes one turn, if AI is able to make one more turn method will be called again automatically /// </summary> private void MakeTurn() { controller.ArmyFinishedMove -= MakeTurn; var gameSimulation = new GameSimulation(boardStorage); var myArmiesNumber = gameSimulation.GetNumberOfActiveArmies(playerType); if (myArmiesNumber == 0) { FinishTurn(); return; } var bestMove = gameSimulation.FindBestMove(playerType); // if it's better not to move for all armies if (bestMove == null) { FinishTurn(); return; } OnTurnEnd(bestMove); }