protected virtual ReadOnlyCollection <Move> GetValidMoves(Position from, bool returnIfAny)
{
ChessUtilities.ThrowIfNull(from, "from");
Piece piece = GetPieceAt(from);
if (piece == null || piece.Owner != WhoseTurn)
{
return(new ReadOnlyCollection <Move>(new List <Move>()));
}
return(piece.GetValidMoves(from, returnIfAny, this, IsValidMove));
}