Example #1
0
 // calculate possible moves for specific figure, checking the borders etc.
 // will return list of Tiles for future move
 protected override List<Tile> SetPossibleMoves(Board _board)
 {
     //possibleMoves.Add(possibleTile);
     return possibleMoves;
 }
Example #2
0
 // default constructor
 public Bishop(String _colour, Board _board, Tile _tile)
     : base(_colour, _board, _tile)
 {
     SetPossibleMoves(_board);
 }
Example #3
0
 protected abstract List<Tile> SetPossibleMoves(Board _board);
Example #4
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);
 }
Example #5
0
 public List<Tile> GetPossibleMoves(Board _board)
 {
     return possibleMoves;
 }
Example #6
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;
 }