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

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

Derived Implementations

impl Clone for GameState

fn clone(&self) -> GameState

fn clone_from(&mut self, source: &Self)