Enum shakmaty_syzygy::Wdl
source · #[repr(i8)]
pub enum Wdl {
Loss,
BlessedLoss,
Draw,
CursedWin,
Win,
}
Expand description
5-valued evaluation of a position in the context of the 50-move drawing rule.
Variants
Loss
Unconditional loss for the side to move.
BlessedLoss
Loss that can be saved by the 50-move rule.
Draw
Unconditional draw.
CursedWin
Win that can be frustrated by the 50-move rule.
Win
Unconditional win.
Implementations
sourceimpl Wdl
impl Wdl
sourcepub fn from_outcome(outcome: Outcome, pov: Color) -> Wdl
pub fn from_outcome(outcome: Outcome, pov: Color) -> Wdl
Converts outcome
to a Wdl
from the given point of view.
sourcepub fn from_dtz_after_zeroing(dtz: Dtz) -> Wdl
pub fn from_dtz_after_zeroing(dtz: Dtz) -> Wdl
Converts dtz
to a Wdl
.
Typically the result would be ambiguous for absolute DTZ values 100. This conversion assumes that such values were given immediately after a capture or pawn move, in which case the outcome is an unconditional win or loss.
Trait Implementations
sourceimpl Ord for Wdl
impl Ord for Wdl
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Wdl> for Wdl
impl PartialOrd<Wdl> for Wdl
sourcefn partial_cmp(&self, other: &Wdl) -> Option<Ordering>
fn partial_cmp(&self, other: &Wdl) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Wdl
impl Eq for Wdl
impl StructuralEq for Wdl
impl StructuralPartialEq for Wdl
Auto Trait Implementations
impl RefUnwindSafe for Wdl
impl Send for Wdl
impl Sync for Wdl
impl Unpin for Wdl
impl UnwindSafe for Wdl
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more