pub struct PackedEval {
    pub data: i32,
}

Fields§

§data: i32

Implementations§

source§

impl PackedEval

source

pub const fn new(opening: i16, ending: i16) -> Self

Constructs a new instance of PackedEval with opening and ending scores.

source

pub const fn new_raw(data: i32) -> Self

Constructs a new instance of PackedEval with raw data.

source

pub fn get_opening(&self) -> i16

Gets opening score from the internal data.

source

pub fn get_ending(&self) -> i16

Gets ending score from the internal data.

source

pub fn taper_score(&self, game_phase: u8) -> i16

Blends opening_score and ending_score with the ratio passed in game_phase. The ratio is a number from 0 to max_game_phase, where:

  • max_game_phase represents a board with the initial state set (opening phase)
  • 0 represents a board without any piece (ending phase)
  • every value between them represents a board state somewhere in the middle game

Trait Implementations§

source§

impl Add for PackedEval

source§

fn add(self, rhs: PackedEval) -> PackedEval

Implements + operator for PackedEval.

§

type Output = PackedEval

The resulting type after applying the + operator.
source§

impl AddAssign for PackedEval

source§

fn add_assign(&mut self, rhs: PackedEval)

Implements += operator for PackedEval.

source§

impl Clone for PackedEval

source§

fn clone(&self) -> PackedEval

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Default for PackedEval

source§

fn default() -> PackedEval

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

impl Mul<PackedEval> for i16

source§

fn mul(self, rhs: PackedEval) -> PackedEval

Implements * operator for PackedEval.

§

type Output = PackedEval

The resulting type after applying the * operator.
source§

impl Mul<PackedEval> for i32

source§

fn mul(self, rhs: PackedEval) -> PackedEval

Implements * operator for PackedEval.

§

type Output = PackedEval

The resulting type after applying the * operator.
source§

impl Mul<PackedEval> for i8

source§

fn mul(self, rhs: PackedEval) -> PackedEval

Implements * operator for PackedEval.

§

type Output = PackedEval

The resulting type after applying the * operator.
source§

impl Sub for PackedEval

source§

fn sub(self, rhs: PackedEval) -> PackedEval

Implements - operator for PackedEval.

§

type Output = PackedEval

The resulting type after applying the - operator.
source§

impl SubAssign for PackedEval

source§

fn sub_assign(&mut self, rhs: PackedEval)

Implements -= operator for PackedEval.

source§

impl Copy for PackedEval

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> 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,

§

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>,

§

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 T
where 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.