예제 #1
0
        internal Tile[,] board; // internal - because our classes must use this array and must be invisible for executable code

        #endregion Fields

        #region Constructors

        public Board()
        {
            board = new Tile [8, 8];
            for (uint column = 0; column < 8; column++)
                for (uint row = 0; row < 8; row++)
                    board[row, column] = new Tile(row, column);
        }
예제 #2
0
 // move for all figures will the same, but possible moves will be different
 public void Move(Board _board, Tile _moveTile)
 {
     //if possibleMoves contain _moveTile then
     _board.board[_moveTile.x, _moveTile.y].figOnTile = this;
     _board.board[currentTile.x, currentTile.y].figOnTile = null;
     currentTile = _moveTile;
     SetPossibleMoves(_board);
 }
예제 #3
0
 // default constructor
 public Bishop(String _colour, Board _board, Tile _tile)
     : base(_colour, _board, _tile)
 {
     SetPossibleMoves(_board);
 }
예제 #4
0
 public Figure(String _colour, Board _board, Tile _tile)
 {
     colour = _colour;
     _board.board[_tile.x, _tile.y].figOnTile = this;    // Add this figure on board
     currentTile = _tile;
 }