pub struct Game {
pub deck: Deck,
pub players: Vec<Player>,
pub inactive_players: Vec<InactivePlayer>,
pub is_finished: bool,
/* private fields */
}Expand description
Handling for a game of Go Fish
Fields§
§deck: Deck§players: Vec<Player>§inactive_players: Vec<InactivePlayer>§is_finished: boolImplementations§
Source§impl Game
impl Game
Sourcepub fn new(deck: Deck, player_count: u8) -> Game
pub fn new(deck: Deck, player_count: u8) -> Game
Create a new Game of Go Fish, with the given Deck and number of players
Sourcepub fn take_turn(&mut self, hook: Hook) -> Result<HookOutcome, TurnError>
pub fn take_turn(&mut self, hook: Hook) -> Result<HookOutcome, TurnError>
Take a turn in the game
Sourcepub fn get_current_player(&self) -> Option<&Player>
pub fn get_current_player(&self) -> Option<&Player>
Get the current player
pub fn get_game_result(&self) -> Option<GameResult>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Game
impl<'de> Deserialize<'de> for Game
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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