예제 #1
0
파일: GameState.cs 프로젝트: Bawaw/Reversi
 protected State( ICell<State> state, GameBoard board )
 {
     this.state = state;
     this.board = board;
 }
예제 #2
0
파일: GameState.cs 프로젝트: Bawaw/Reversi
 public InProgress( ICell<State> state, GameBoard board, Player player )
     : base(state, board)
 {
     this.currentPlayer = player;
 }
예제 #3
0
파일: GameState.cs 프로젝트: Bawaw/Reversi
 private GameState( GameBoard initialBoard, Player initialPlayer )
     : this(CreateInitialState( initialBoard, initialPlayer ))
 {
     // NOP
 }
예제 #4
0
파일: GameState.cs 프로젝트: Bawaw/Reversi
 public GameOver( ICell<State> state, GameBoard board )
     : base(state, board)
 {
 }
예제 #5
0
파일: GameState.cs 프로젝트: Bawaw/Reversi
        private static ICell<State> CreateInitialState( GameBoard initialBoard, Player initialPlayer )
        {
            if ( !initialBoard.HasValidMove( initialPlayer ) )
            {
                throw new ArgumentException( "No move available for given player" );
            }
            else
            {
                var state = new Cell<State>();
                state.Value = new InProgress( state, initialBoard, initialPlayer );

                return state;
            }
        }
예제 #6
0
파일: GameBoard.cs 프로젝트: Bawaw/Reversi
 public bool Equals( GameBoard gameBoard )
 {
     return this.grid.Equals( gameBoard.grid );
 }