/// <see cref="IChessBoardCell.RemoveChessPiece"/> public void RemoveChessPiece() { if (containingChessPiece == null) { return; } containingChessPiece.SetParent(null); containingChessPiece = null; }
/// <see cref="IChessBoardCell.PlaceChessPiece(IChessPiece)"/> public void PlaceChessPiece(IChessPiece chessPiece) { if (!IsEmpty) { throw new InvalidOperationException("Cell already contains a chess piece"); } if (chessPiece == null) { throw new ArgumentNullException(nameof(chessPiece)); } containingChessPiece = chessPiece; containingChessPiece.SetParent(this); }