public override string ToString() { return(string.Format("{0}x{1}{2}e.p.{3}", MoveUtilities.GetFileFromInt(StartingSquare.Coordinate.File), MoveUtilities.GetFileFromInt(EndingSquare.Coordinate.File), EndingSquare.Coordinate.Rank, GetCheckNotation())); }
protected string GetPieceNotation() { var startingFile = MoveUtilities.GetFileFromInt(StartingSquare.Coordinate.File); return(MovedPiece is Pawn && IsCapture ? startingFile : MovedPiece.GetNotation()); }
public SquareCoordinate(int rank, int file) { if (!MoveUtilities.IsValidPosition(rank, file)) { throw new ArgumentException(); } File = file; Rank = rank; }
private bool GetIsValidCastleMove(Board board, Square startingSquare, Square endingSquare, out CastleType?castleType, out King king) { castleType = null; king = startingSquare.Piece as King; if (king == null) { return(false); } return(IsCastleMove(king, startingSquare, endingSquare, out castleType) && MoveUtilities.CanCastle(king, board, castleType.Value)); }
protected string GetDisambiguating() { if (_ambiguousMoveStartingSquare == null) { return(String.Empty); } else if (_ambiguousMoveStartingSquare.Coordinate.File == StartingSquare.Coordinate.File) { return(StartingSquare.Coordinate.Rank.ToString()); } else { return(MoveUtilities.GetFileFromInt(StartingSquare.Coordinate.File)); } }
public override string ToString() { var piece = GetPieceNotation(); var endingFile = MoveUtilities.GetFileFromInt(EndingSquare.Coordinate.File); var rank = EndingSquare.Coordinate.Rank; var isCapture = GetCaptureNotation(IsCapture); var check = GetCheckNotation(); var disambiguating = GetDisambiguating(); return(string.Format("{0}{1}{2}{3}{4}{5}", piece, disambiguating, isCapture, endingFile, rank, check)); }
protected override IEnumerable <SquareCoordinate> GetNewControlledSquares(Board board) { return(MoveUtilities.GetLineAvailability(CurrentSquare.Coordinate, board, Color, SquareInfluenceType.Control)); }
internal IEnumerable <SquareCoordinate> GetFrontSquares() { return(MoveUtilities.GetPawnFrontSquares(CurrentSquare.Coordinate, Color)); }
protected override IEnumerable <SquareCoordinate> GetAvailableMoves(Board board) { return(MoveUtilities.GetPawnAvailability(CurrentSquare.Coordinate, board, Color, SquareInfluenceType.Mobility)); }
public override string ToString() { var file = MoveUtilities.GetFileFromInt(File); return(file.ToString() + Rank); }
public override bool IsPieceMove(Square startingSquare, Square endingSquare, Piece capturedPiece) { return(MoveUtilities.IsKingValidMove(startingSquare.Coordinate, endingSquare.Coordinate)); }