public void PutChessPiece(Chessman chessman, Position position) { if (ChessmanAlreadyExists(position)) { throw new ChessBoardException("Já existe uma peça nessa posição!"); } ChessPieces[position.Row, position.Column] = chessman; chessman.PiecePosition = position; }
public Chessman RemoveChessPiece(Position position) { if (ChessPiece(position) == null) { return(null); } Chessman chessman = ChessPiece(position); chessman.PiecePosition = null; ChessPieces[position.Row, position.Column] = null; return(chessman); }