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 |
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.