예제 #1
0
        private Player(ActivePlayer colorJugador, IODevice iODevice)
        {
            if (colorJugador != ActivePlayer.Red && colorJugador != ActivePlayer.Yellow)
            {
                throw new ArgumentOutOfRangeException("playerColor");
            }

            this.playerColor = colorJugador;
            this.iODevice    = iODevice;
        }
예제 #2
0
 public HumanConsolePlayer(ActivePlayer color, IODevice iOdevice)
     : base(color, iOdevice)
 {
 }
예제 #3
0
 public ComputerConsolePlayer(ActivePlayer color, DifficultyLevel difficulty, IODevice iODevice)
     : base(color, iODevice)
 {
     engine = new Computer(difficulty);
 }
예제 #4
0
 public static Player CreateComputerPlayer(ActivePlayer color, DifficultyLevel difficultyLevel, IODevice iODevice)
 {
     return(new ComputerConsolePlayer(color, difficultyLevel, iODevice));
 }
예제 #5
0
 public static Player CreateHumanPlayer(ActivePlayer color, IODevice iODevice)
 {
     return(new HumanConsolePlayer(color, iODevice));
 }
예제 #6
0
            public ConsoleGame(DifficultyLevel difficultyLevel, ActivePlayer computerColor, bool computerPlaysFirst, IODevice iODevice)
                : base(difficultyLevel, computerColor, computerPlaysFirst, iODevice)
            {
                computerPlayer = Player.CreateComputerPlayer(computerColor, difficultyLevel, iODevice);
                humanPlayer    = Player.CreateHumanPlayer(computerColor == ActivePlayer.Red ? ActivePlayer.Yellow : ActivePlayer.Red, iODevice);

                if (computerPlaysFirst)
                {
                    activePlayer = computerPlayer;
                }
                else
                {
                    activePlayer = humanPlayer;
                }

                this.iODevice = iODevice;
            }
예제 #7
0
 private Game(DifficultyLevel difficultyLevel, ActivePlayer computerColor, bool computerHasFirstTurn, IODevice iODevice)
 {
     board         = Board.EmptyBoard;
     this.iODevice = iODevice;
 }
예제 #8
0
 public static Game CreateConsoleGame(DifficultyLevel difficultyLevel, ActivePlayer colorOrdenador, bool computerHasFirstTurn)
 {
     return(new ConsoleGame(difficultyLevel, colorOrdenador, computerHasFirstTurn, IODevice.CreateConsoleDevice()));
 }