pub struct TacticsFacts {Show 33 fields
pub available: bool,
pub check_count: u16,
pub check_by_role: [bool; 5],
pub safe_check_count: u16,
pub safe_check_by_role: [bool; 5],
pub double_check_available: bool,
pub discovered_check_available: bool,
pub mate_in_1: bool,
pub stalemate_in_1: bool,
pub promotion_files: FileSet,
pub promotion_roles: [bool; 4],
pub safe_promotion_files: FileSet,
pub capture_count: u16,
pub winning_capture_available: bool,
pub winning_capture_max_gain: i32,
pub captures_hanging: bool,
pub hanging_victim_max_value: i32,
pub equal_capture_count: u16,
pub losing_capture_count: u16,
pub fork_count: u16,
pub fork_max_value: i32,
pub knight_fork_available: bool,
pub royal_fork_available: bool,
pub pin_creation_count: u16,
pub skewer_creation_available: bool,
pub discovered_attack_available: bool,
pub legal_move_count: u16,
pub safe_check_capturing: bool,
pub discovered_attack_on_queen: bool,
pub back_rank_mate_threat: bool,
pub quiet_threat_available: bool,
pub no_safe_moves: bool,
pub promotion_see_positive: bool,
}Expand description
One side’s one-ply tactical options.
The block for Side::Them is computed after a null move; when the side to
move is in check that move does not exist and the whole block is zero, with
available false.
Fields§
§available: boolThe block could be computed.
check_count: u16Moves giving check.
check_by_role: [bool; 5]A checking move exists per moving role P, N, B, R, Q.
safe_check_count: u16Checking moves whose destination is safe.
safe_check_by_role: [bool; 5]A safe checking move exists per moving role P, N, B, R, Q.
double_check_available: boolA move gives check from two units at once.
discovered_check_available: boolA move gives check with a unit that did not move.
mate_in_1: boolA move leaves the opponent checkmated.
stalemate_in_1: boolA move leaves the opponent stalemated.
promotion_files: FileSetFiles a legal move promotes on.
promotion_roles: [bool; 4]A promotion to each of Q, R, B, N is available.
safe_promotion_files: FileSetFiles a legal promotion with a safe destination lands on.
capture_count: u16Capturing moves.
winning_capture_available: boolA capture whose victim outvalues the capturer or is undefended.
winning_capture_max_gain: i32The largest victim − capturer over the captures, at least 0.
captures_hanging: boolA capture of a hanging unit.
hanging_victim_max_value: i32The largest value among the hanging units capturable now.
equal_capture_count: u16Captures of a defended unit of equal value.
losing_capture_count: u16Captures of a defended unit of lower value.
fork_count: u16Moves after which the moved unit forks.
fork_max_value: i32The largest single forked value.
knight_fork_available: boolA fork by a knight.
royal_fork_available: boolA fork one of whose targets is the king.
pin_creation_count: u16Moves creating an absolute or a relative pin.
skewer_creation_available: boolA move creating a skewer.
discovered_attack_available: boolA move uncovering a slider’s attack on a unit of value 3 or more.
legal_move_count: u16Legal moves.
safe_check_capturing: boolA checking move that captures and whose destination is safe.
discovered_attack_on_queen: boolA move uncovering a slider’s attack on the enemy queen.
back_rank_mate_threat: boolA move after which a rook or queen of the side checks the enemy king along that king’s own rank, its back rank being blocked.
quiet_threat_available: boolA quiet move after which the largest SEE of a unit over the enemy’s units is greater than it is now.
no_safe_moves: boolNo legal move has a safe destination.
promotion_see_positive: boolA promotion whose SEE is above 0.
Implementations§
Source§impl TacticsFacts
impl TacticsFacts
Sourcepub fn check_available(&self) -> bool
pub fn check_available(&self) -> bool
Whether a checking move exists.
Sourcepub fn safe_check_available(&self) -> bool
pub fn safe_check_available(&self) -> bool
Whether a checking move with a safe destination exists.
Sourcepub fn promotion_available(&self) -> bool
pub fn promotion_available(&self) -> bool
Whether a promotion is available.
Sourcepub fn safe_promotion_available(&self) -> bool
pub fn safe_promotion_available(&self) -> bool
Whether a promotion with a safe destination is available.
Sourcepub fn capture_available(&self) -> bool
pub fn capture_available(&self) -> bool
Whether a capture is available.
Sourcepub fn fork_available(&self) -> bool
pub fn fork_available(&self) -> bool
Whether a forking move is available.
Sourcepub fn pin_creation_available(&self) -> bool
pub fn pin_creation_available(&self) -> bool
Whether a move creating a pin is available.
Sourcepub fn only_moves(&self) -> bool
pub fn only_moves(&self) -> bool
Whether the side to move has at most two legal moves. False for a block that could not be computed, which has no side to move.
Trait Implementations§
Source§impl Clone for TacticsFacts
impl Clone for TacticsFacts
Source§fn clone(&self) -> TacticsFacts
fn clone(&self) -> TacticsFacts
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more