Struct simple_cards::deck::Deck
source · pub struct Deck { /* private fields */ }Implementations§
source§impl Deck
impl Deck
sourcepub fn new() -> Deck
pub fn new() -> Deck
Creates a new, ordered deck of 52 cards.
Use Deck::default() to get one pre-shuffled.
sourcepub fn add_bottom(&mut self, card: Card)
pub fn add_bottom(&mut self, card: Card)
Adds a card to the front of the deck.
sourcepub fn add_deck(&mut self, deck: &mut Deck)
pub fn add_deck(&mut self, deck: &mut Deck)
Adds a deck of cards, one by one, to the bottom of this deck.
sourcepub fn draw(&mut self) -> Option<Card>
pub fn draw(&mut self) -> Option<Card>
Draws one card from the front of the deck, returning an Option
sourcepub fn draw_bottom(&mut self) -> Option<Card>
pub fn draw_bottom(&mut self) -> Option<Card>
Draws one card from the bottom of the deck, return an Option