Esempio n. 1
0
        public void SetUp()
        {
            var hmm  = new HumanConsoleMakeMove();
            var aimm = new AIMakeMove();

            _gameCon = new GameController(new WinCondition(), new HumanPlayer(hmm), new AIPlayer(aimm), new FakeConsoleIO());
        }
Esempio n. 2
0
        static void Main()
        {
            GameController GameCon;
            var            hcmm = new HumanConsoleMakeMove();
            var            aimm = new AIMakeMove();
            var            play = true;

            while (play)
            {
                Console.Title = "Tic-Tac-Toe";
                Console.Clear();
                Console.WriteLine("Please enter the number of players (0-2): ");
                var numberOfHumanPlayers = GetCorrectNumberOfPlayers();


                if (numberOfHumanPlayers == 0)
                {
                    GameCon = new GameController(
                        new WinCondition(),
                        new AIPlayer(aimm),
                        new AIPlayer(aimm),
                        new ConsoleIO());
                }
                else if (numberOfHumanPlayers == 1)
                {
                    GameCon = new GameController(
                        new WinCondition(),
                        new HumanPlayer(hcmm),
                        new AIPlayer(aimm),
                        new ConsoleIO());
                }
                else
                {
                    GameCon = new GameController(
                        new WinCondition(),
                        new HumanPlayer(hcmm),
                        new HumanPlayer(hcmm),
                        new ConsoleIO());
                }
                play = GameCon.Run();
            }
        }
Esempio n. 3
0
        public void Setup()
        {
            var hmm = new HumanConsoleMakeMove();

            _p = new HumanPlayer(hmm);
        }