pub struct Game { /* private fields */ }Expand description
Deterministic Daifugo game state.
Implementations§
Source§impl Game
impl Game
Sourcepub fn deal(
players: impl IntoIterator<Item = Player>,
deck: impl IntoIterator<Item = Card>,
rules: Rules,
) -> Result<Self, Error>
pub fn deal( players: impl IntoIterator<Item = Player>, deck: impl IntoIterator<Item = Card>, rules: Rules, ) -> Result<Self, Error>
Deals the supplied pre-shuffled deck round-robin to two through eight unique players. The holder of three of clubs starts when present; otherwise seat zero starts.
Sourcepub fn current_player_id(&self) -> Option<&str>
pub fn current_player_id(&self) -> Option<&str>
Returns the current player ID.
Sourcepub const fn revolution(&self) -> bool
pub const fn revolution(&self) -> bool
Returns whether revolution is active.
Sourcepub fn finish_order(&self) -> impl Iterator<Item = &str>
pub fn finish_order(&self) -> impl Iterator<Item = &str>
Returns finishing player IDs in rank order.
Sourcepub fn view_for(&self, player_id: &str) -> Result<PlayerView, Error>
pub fn view_for(&self, player_id: &str) -> Result<PlayerView, Error>
Builds a hidden-information observation for one seat.
Trait Implementations§
impl Eq for Game
impl StructuralPartialEq for Game
Auto Trait Implementations§
impl Freeze for Game
impl RefUnwindSafe for Game
impl Send for Game
impl Sync for Game
impl Unpin for Game
impl UnsafeUnpin for Game
impl UnwindSafe for Game
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