Struct libcoinche::cards::Deck [] [src]

pub struct Deck {
    // some fields omitted
}

A deck of cards.

Methods

impl Deck

fn new() -> Self

Returns a full, sorted deck of 32 cards.

fn shuffle(&mut self)

Shuffle this deck.

fn shuffle_seeded(&mut self, seed: &[u32])

Shuffle this deck with the given random seed.

Result is determined by the seed.

fn draw(&mut self) -> Card

Draw the top card from the deck.

Panics

If self is empty.

fn is_empty(&self) -> bool

Returns true if this deck is empty.

fn len(&self) -> usize

Returns the number of cards left in this deck.

fn deal_each(&mut self, hands: &mut [Hand; 4], n: usize)

Deal n cards to each hand.

Panics

If self.len() < 4 * n

Trait Implementations

impl ToString for Deck

fn to_string(&self) -> String