pub struct EvaluationResult {
    pub opening_score: i16,
    pub ending_score: i16,
}

Fields§

§opening_score: i16§ending_score: i16

Implementations§

source§

impl EvaluationResult

source

pub fn new(opening_score: i16, ending_score: i16) -> EvaluationResult

source

pub fn taper_score(&self, game_phase: u8, max_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<EvaluationResult> for EvaluationResult

§

type Output = EvaluationResult

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<EvaluationResult> for i16

§

type Output = EvaluationResult

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Add<i16> for EvaluationResult

§

type Output = EvaluationResult

The resulting type after applying the + operator.
source§

fn add(self, rhs: i16) -> EvaluationResult

Performs the + operation. Read more
source§

impl Sub<EvaluationResult> for EvaluationResult

§

type Output = EvaluationResult

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more

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.