public void putPiece(Pieces p, Position pos)//put the piece in the board { if (existPiece(pos)) { throw new BoardException("Theres a piece in this position"); } PiecesBoard[pos.Row, pos.Column] = p; p.Position = pos; }
public Pieces removePiece(Position pos) { if (piece(pos) == null) { return(null); } Pieces aux = piece(pos); aux.Position = null; PiecesBoard[pos.Row, pos.Column] = null; return(aux); }