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: [Option<Card>; 4]

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

first: PlayerPos

First player in this trick.

winner: PlayerPos

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

Methods

impl Trick
[src]

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

impl Debug for Trick
[src]

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

Formats the value using the given formatter.

impl Encodable for Trick
[src]

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

impl Clone for Trick
[src]

fn clone(&self) -> Trick

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