public abstract GetValidMoves ( |
||
from | ||
returnIfAny | bool | |
game | ||
gameMoveValidator | bool>.Func | |
return | ReadOnlyCollection |
public abstract ReadOnlyCollection<Move> GetValidMoves(Position from, bool returnIfAny, ChessGame game, Func<Move, bool> gameMoveValidator);
}
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)); }