Struct simple_cards::deck::Deck
[−]
[src]
pub struct Deck { /* fields omitted */ }
Methods
impl Deck[src]
fn new() -> Deck[src]
Creates a new, ordered deck of 52 cards.
fn new_empty() -> Deck[src]
Creates a new, empty deck.
fn len(&self) -> usize[src]
Returns the amount of cards in the deck.
fn show(&self, idx: usize) -> &Card[src]
Returns reference to a card given an index.
fn add(&mut self, card: Card)[src]
Adds a card to the bottom of the deck.
fn add_bottom(&mut self, card: Card)[src]
Adds a card to the front of the deck.
fn add_deck(&mut self, deck: &mut Deck)[src]
Adds a deck of cards, one by one, to the bottom of this deck.
fn draw(&mut self) -> Option<Card>[src]
Draws one card from the front of the deck, returning an Option
fn draw_bottom(&mut self) -> Option<Card>[src]
Draws one card from the bottom of the deck, return an Option
fn shuffle(&mut self)[src]
Shuffles the deck.