Exemple #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;
        }
Exemple #2
0
 public HumanConsolePlayer(ActivePlayer color, IODevice iOdevice)
     : base(color, iOdevice)
 {
 }
Exemple #3
0
 public ComputerConsolePlayer(ActivePlayer color, DifficultyLevel difficulty, IODevice iODevice)
     : base(color, iODevice)
 {
     engine = new Computer(difficulty);
 }
Exemple #4
0
 public static Player CreateComputerPlayer(ActivePlayer color, DifficultyLevel difficultyLevel, IODevice iODevice)
 {
     return(new ComputerConsolePlayer(color, difficultyLevel, iODevice));
 }
Exemple #5
0
 public static Player CreateHumanPlayer(ActivePlayer color, IODevice iODevice)
 {
     return(new HumanConsolePlayer(color, iODevice));
 }
Exemple #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;
            }
Exemple #7
0
 private Game(DifficultyLevel difficultyLevel, ActivePlayer computerColor, bool computerHasFirstTurn, IODevice iODevice)
 {
     board         = Board.EmptyBoard;
     this.iODevice = iODevice;
 }
Exemple #8
0
 public static Game CreateConsoleGame(DifficultyLevel difficultyLevel, ActivePlayer colorOrdenador, bool computerHasFirstTurn)
 {
     return(new ConsoleGame(difficultyLevel, colorOrdenador, computerHasFirstTurn, IODevice.CreateConsoleDevice()));
 }