public static (bool, Move) Locate(this Move move, IPosition pos) { // force position to contain the latest moves for the position moves to be searched in var moveList = pos.GenerateMoves(); var element = moveList.GetMove(move.GetFromSquare(), move.GetToSquare()); return(element == null ? (false, EmptyMove) : (true, element)); }
public Move MoveFromUci(IPosition pos, string uciMove) { var moveList = pos.GenerateMoves(); foreach (var move in moveList.Get()) { if (uciMove.Equals(move.Move.ToString(), StringComparison.InvariantCultureIgnoreCase)) { return(move); } } return(Move.EmptyMove); }
private char GetCheckChar() => _pos.GenerateMoves().Any() ? '+' : '#';
private static char GetCheckChar(this IPosition pos) => pos.GenerateMoves().Any() ? '+' : '#';