Exemplo n.º 1
0
        public static Game SetupGame(GameModeChoice gameMode, string p1Name, string p2Name)
        {
            Game game = null;

            if (gameMode == GameModeChoice.PvP)
            {
                game = new Game(new HumanPlayer(p1Name), new HumanPlayer(p2Name));
            }
            else if (gameMode == GameModeChoice.PvC)
            {
                if (ColorMenu.GetColor() == ColorChoice.White)
                {
                    game = new Game(new HumanPlayer(p1Name), new ComputerPlayer(p2Name));
                }
                else
                {
                    game = new Game(new ComputerPlayer(p1Name), new HumanPlayer(p2Name));
                }
            }
            else if (gameMode == GameModeChoice.CvC)
            {
                game = new Game(new ComputerPlayer(p1Name), new ComputerPlayer(p2Name));
            }
            return(game);
        }