pub struct View<'a> { /* private fields */ }Expand description
What the acting player looks at while deciding.
Yahtzee is a perfect-information game, so this is a convenience bundle rather than a hygiene wall: it points the strategy at its own card, the dice, and the rolls remaining, with opponents available for match-aware play.
Implementations§
Source§impl<'a> View<'a>
impl<'a> View<'a>
Sourcepub fn dice(&self) -> Dice
pub fn dice(&self) -> Dice
The dice on the table.
§Panics
Panics if no dice are showing; the engine only consults a strategy while they are.
Sourcepub const fn rolls_left(&self) -> u8
pub const fn rolls_left(&self) -> u8
How many rolls remain this turn.
Sourcepub fn legal_categories(&self) -> Categories
pub fn legal_categories(&self) -> Categories
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for View<'a>
impl<'a> RefUnwindSafe for View<'a>
impl<'a> Send for View<'a>
impl<'a> Sync for View<'a>
impl<'a> Unpin for View<'a>
impl<'a> UnsafeUnpin for View<'a>
impl<'a> UnwindSafe for View<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more