Skip to main content

TacticsFacts

Struct TacticsFacts 

Source
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: bool

The block could be computed.

§check_count: u16

Moves giving check.

§check_by_role: [bool; 5]

A checking move exists per moving role P, N, B, R, Q.

§safe_check_count: u16

Checking 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: bool

A move gives check from two units at once.

§discovered_check_available: bool

A move gives check with a unit that did not move.

§mate_in_1: bool

A move leaves the opponent checkmated.

§stalemate_in_1: bool

A move leaves the opponent stalemated.

§promotion_files: FileSet

Files a legal move promotes on.

§promotion_roles: [bool; 4]

A promotion to each of Q, R, B, N is available.

§safe_promotion_files: FileSet

Files a legal promotion with a safe destination lands on.

§capture_count: u16

Capturing moves.

§winning_capture_available: bool

A capture whose victim outvalues the capturer or is undefended.

§winning_capture_max_gain: i32

The largest victim − capturer over the captures, at least 0.

§captures_hanging: bool

A capture of a hanging unit.

§hanging_victim_max_value: i32

The largest value among the hanging units capturable now.

§equal_capture_count: u16

Captures of a defended unit of equal value.

§losing_capture_count: u16

Captures of a defended unit of lower value.

§fork_count: u16

Moves after which the moved unit forks.

§fork_max_value: i32

The largest single forked value.

§knight_fork_available: bool

A fork by a knight.

§royal_fork_available: bool

A fork one of whose targets is the king.

§pin_creation_count: u16

Moves creating an absolute or a relative pin.

§skewer_creation_available: bool

A move creating a skewer.

§discovered_attack_available: bool

A move uncovering a slider’s attack on a unit of value 3 or more.

§legal_move_count: u16

Legal moves.

§safe_check_capturing: bool

A checking move that captures and whose destination is safe.

§discovered_attack_on_queen: bool

A move uncovering a slider’s attack on the enemy queen.

§back_rank_mate_threat: bool

A 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: bool

A quiet move after which the largest SEE of a unit over the enemy’s units is greater than it is now.

§no_safe_moves: bool

No legal move has a safe destination.

§promotion_see_positive: bool

A promotion whose SEE is above 0.

Implementations§

Source§

impl TacticsFacts

Source

pub fn check_available(&self) -> bool

Whether a checking move exists.

Source

pub fn safe_check_available(&self) -> bool

Whether a checking move with a safe destination exists.

Source

pub fn promotion_available(&self) -> bool

Whether a promotion is available.

Source

pub fn safe_promotion_available(&self) -> bool

Whether a promotion with a safe destination is available.

Source

pub fn capture_available(&self) -> bool

Whether a capture is available.

Source

pub fn fork_available(&self) -> bool

Whether a forking move is available.

Source

pub fn pin_creation_available(&self) -> bool

Whether a move creating a pin is available.

Source

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

Source§

fn clone(&self) -> TacticsFacts

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TacticsFacts

Source§

impl Debug for TacticsFacts

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TacticsFacts

Source§

fn default() -> TacticsFacts

Returns the “default value” for a type. Read more
Source§

impl Eq for TacticsFacts

Source§

impl PartialEq for TacticsFacts

Source§

fn eq(&self, other: &TacticsFacts) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TacticsFacts

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.