Struct inanis::evaluation::PackedEval
source · pub struct PackedEval {
pub data: i32,
}
Fields§
§data: i32
Implementations§
source§impl PackedEval
impl PackedEval
sourcepub const fn new(opening: i16, ending: i16) -> Self
pub const fn new(opening: i16, ending: i16) -> Self
Constructs a new instance of PackedEval with opening
and ending
scores.
sourcepub const fn new_raw(data: i32) -> Self
pub const fn new_raw(data: i32) -> Self
Constructs a new instance of PackedEval with raw data
.
sourcepub fn get_opening(&self) -> i16
pub fn get_opening(&self) -> i16
Gets opening score from the internal data.
sourcepub fn get_ending(&self) -> i16
pub fn get_ending(&self) -> i16
Gets ending score from the internal data.
sourcepub fn taper_score(&self, game_phase: u8) -> i16
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
impl Add for PackedEval
source§fn add(self, rhs: PackedEval) -> PackedEval
fn add(self, rhs: PackedEval) -> PackedEval
Implements +
operator for PackedEval.
§type Output = PackedEval
type Output = PackedEval
The resulting type after applying the
+
operator.source§impl AddAssign for PackedEval
impl AddAssign for PackedEval
source§fn add_assign(&mut self, rhs: PackedEval)
fn add_assign(&mut self, rhs: PackedEval)
Implements +=
operator for PackedEval.
source§impl Clone for PackedEval
impl Clone for PackedEval
source§fn clone(&self) -> PackedEval
fn clone(&self) -> PackedEval
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for PackedEval
impl Default for PackedEval
source§fn default() -> PackedEval
fn default() -> PackedEval
Returns the “default value” for a type. Read more
source§impl Mul<PackedEval> for i16
impl Mul<PackedEval> for i16
source§fn mul(self, rhs: PackedEval) -> PackedEval
fn mul(self, rhs: PackedEval) -> PackedEval
Implements *
operator for PackedEval.
§type Output = PackedEval
type Output = PackedEval
The resulting type after applying the
*
operator.source§impl Mul<PackedEval> for i32
impl Mul<PackedEval> for i32
source§fn mul(self, rhs: PackedEval) -> PackedEval
fn mul(self, rhs: PackedEval) -> PackedEval
Implements *
operator for PackedEval.
§type Output = PackedEval
type Output = PackedEval
The resulting type after applying the
*
operator.source§impl Mul<PackedEval> for i8
impl Mul<PackedEval> for i8
source§fn mul(self, rhs: PackedEval) -> PackedEval
fn mul(self, rhs: PackedEval) -> PackedEval
Implements *
operator for PackedEval.
§type Output = PackedEval
type Output = PackedEval
The resulting type after applying the
*
operator.source§impl Sub for PackedEval
impl Sub for PackedEval
source§fn sub(self, rhs: PackedEval) -> PackedEval
fn sub(self, rhs: PackedEval) -> PackedEval
Implements -
operator for PackedEval.
§type Output = PackedEval
type Output = PackedEval
The resulting type after applying the
-
operator.source§impl SubAssign for PackedEval
impl SubAssign for PackedEval
source§fn sub_assign(&mut self, rhs: PackedEval)
fn sub_assign(&mut self, rhs: PackedEval)
Implements -=
operator for PackedEval.
impl Copy for PackedEval
Auto Trait Implementations§
impl RefUnwindSafe for PackedEval
impl Send for PackedEval
impl Sync for PackedEval
impl Unpin for PackedEval
impl UnwindSafe for PackedEval
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more