Struct inanis::engine::see::SEEContainer

source ·
pub struct SEEContainer {
    pub table: Box<[[[i16; 256]; 256]; 6]>,
    pub evaluation_parameters: Arc<EvaluationParameters>,
}

Fields§

§table: Box<[[[i16; 256]; 256]; 6]>§evaluation_parameters: Arc<EvaluationParameters>

Implementations§

source§

impl SEEContainer

source

pub fn new(evaluation_parameters: Option<Arc<EvaluationParameters>>) -> Self

Constructs a default instance of SEEContainer with zeroed elements.

source

pub fn get( &self, attacking_piece: usize, target_piece: usize, attackers: usize, defenders: usize ) -> i16

Gets a result of the static exchange evaluation, based on attacking_piece, target_piece, attackers and defenders.

source

fn evaluate( &self, target_piece: usize, attackers: usize, defenders: usize ) -> i16

Evaluates a static exchange evaluation result, based on target_piece, attackers, defenders.

source

fn evaluate_internal( &self, attacking_piece: usize, target_piece: usize, attackers: usize, defenders: usize ) -> i16

Recursive function called by evaluate to help evaluate a static exchange evaluation result.

source

fn get_see_piece_index(&self, piece: usize) -> usize

Converts piece index to SEE piece index, which supports multiple pieces of the same type stored in one variable:

  • 1 pawn (index 0)
  • 3 knights/bishops (index 1-3)
  • 2 rooks (index 4-5)
  • 1 queen (index 6)
  • 1 king (index 7)
source

fn get_piece_value(&self, piece_index: usize) -> i16

Gets a piece value based on piece_index saved in SEE format (look get_see_piece_index).

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.