Struct libcoinche::game::GameState
[−]
[src]
pub struct GameState { // some fields omitted }
Describes the state of a coinche game, ready to play a card.
Methods
impl GameState
[src]
fn new(first: PlayerPos, hands: [Hand; 4], contract: Contract) -> Self
Creates a new GameState, with the given cards, first player and contract.
fn contract(&self) -> &Contract
Returns the contract used for this game
fn play_card(&mut self, player: PlayerPos, card: Card) -> Result<TrickResult, PlayError>
Try to play a card
fn next_player(&self) -> PlayerPos
Returns the player expected to play next.
fn hands(&self) -> [Hand; 4]
Returns the cards of all players
fn last_trick(&self) -> Result<&Trick, PlayError>
Return the last trick, if possible
fn current_trick(&self) -> &Trick
Returns the current trick.
Trait Implementations
impl Clone for GameState
[src]
fn clone(&self) -> GameState
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more