// 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; }
// default constructor public Bishop(String _colour, Board _board, Tile _tile) : base(_colour, _board, _tile) { SetPossibleMoves(_board); }
protected abstract List<Tile> SetPossibleMoves(Board _board);
// 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); }
public List<Tile> GetPossibleMoves(Board _board) { return possibleMoves; }
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; }