Struct libcoinche::trick::Trick [] [src]

pub struct Trick {
    pub cards: [Option<Card>; 4],
    pub first: PlayerPos,
    pub winner: PlayerPos,
}

The current cards on the table.

Fields

cards

Cards currently on the table (they are None until played).

first

First player in this trick.

winner

Current winner of the trick (updated after each card played).

Methods

impl Trick

fn new(first: PlayerPos) -> Self

Creates a new, empty trick.

fn score(&self, trump: Suit) -> i32

Returns the points value of this trick.

fn play_card(&mut self, player: PlayerPos, card: Card, trump: Suit) -> bool

Plays a card.

Updates the winner.

Returns true if this completes the trick.

fn suit(&self) -> Option<Suit>

Returns the starting suit for this trick.

Returns None if the trick hasn't started yet.

Trait Implementations

Derived Implementations

impl Debug for Trick

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Encodable for Trick

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl Clone for Trick

fn clone(&self) -> Trick

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