/** * Compute attacks and rays. * * These are low-level functions that can be used to implement xiangqi rules. * * @packageDocumentation */ import { SquareSet } from './squareSet.js'; import { Color, Piece, Square } from './types.js'; /** * Check that the move from `origin` to `dest` is valid for a stepping piece. * The last part of the check is to ensure a piece does not wrap around the other side of the board. */ export declare const isValidStep: (origin: Square, dest: Square) => boolean; export declare const KING_SQUARES: { red: number[]; black: number[]; }; export declare const ADVISOR_SQUARES: { red: number[]; black: number[]; }; export declare const ELEPHANT_SQUARES: { red: number[]; black: number[]; }; /** * Gets squares attacked or defended by a king of side `color` on `square`. */ export declare const kingAttacks: (color: Color, square: Square) => SquareSet; /** * Gets squares attacked or defended by an advisor of side `color` on `square`. */ export declare const advisorAttacks: (color: Color, square: Square) => SquareSet; /** * Gets squares attacked or defended by an elephant of side `color` on `square`, given `occupied` squares. */ export declare const elephantAttacks: (color: Color, square: Square, occupied: SquareSet) => SquareSet; /** * Gets squares attacked or defended by a horse on `square` given `occupied`. */ export declare const horseAttacks: (square: Square, occupied: SquareSet) => SquareSet; /** * Gets squares attacked or defended by a pawn of the given `color` * on `square`. */ export declare const pawnAttacks: (color: Color, square: Square) => SquareSet; /** * Gets squares attacked or defended by a chariot on `square`, given `occupied` * squares. */ export declare const chariotAttacks: (square: Square, occupied: SquareSet) => SquareSet; /** * Gets squares attacked or defended by a cannon on `square`, given `occupied`. * If `keepMount` is set to `true`, then also the potential mount (first piece encountered in a ray) * is included in the returned biboard. This is useful to parse SAN moves. * squares. */ export declare const cannonAttacks: (square: Square, occupied: SquareSet, keepMount?: boolean) => SquareSet; /** * Gets squares seen by a `piece` on `square`, given `occupied` squares. */ export declare const attacks: (piece: Piece, square: Square, occupied: SquareSet) => SquareSet; /** * Gets all squares of the rank, file or diagonal with the two squares * `a` and `b`, or an empty set if they are not aligned. */ export declare const ray: (a: Square, b: Square) => SquareSet; /** * Gets all squares between `a` and `b` (bounds not included), or an empty set * if they are not on the same rank or file. */ export declare const between: (a: Square, b: Square) => SquareSet;