Struct libcoinche::cards::Hand
[−]
[src]
pub struct Hand(_);
Represents an unordered set of cards.
Methods
impl Hand
fn new() -> Self
Returns an empty hand.
fn add(&mut self, card: Card) -> &mut Hand
Add card
to self
.
No effect if self
already contains card
.
fn remove(&mut self, card: Card)
Removes card
from self
.
No effect if self
does not contains card
.
fn clean(&mut self)
Remove all cards from self
.
fn has(self, card: Card) -> bool
Returns true
if self
contains card
.
fn has_any(self, suit: Suit) -> bool
Returns true
if the hand contains any card of the given suit.
fn is_empty(self) -> bool
Returns true
if self
contains no card.
fn get_card(self) -> Card
Returns a card from self
.
Returns an invalid card if self
is empty.
fn list(self) -> Vec<Card>
Returns the cards contained in self
as a Vec
.
fn size(self) -> usize
Returns the number of cards in self
.