pub fn contains_hm(&self, card_count: &HashMap<Card, u16>) -> bool {
        
        let card_count_self = self.count_cards();

        for (card, count) in card_count {
            if !card_count_self.contains_key(&card) {
                return false;
            }
            if card_count_self[&card] < *count {
                return false;
            }
        }
         
        true
    }
/// Determine whether a table contains all the cards in a hashmap
///
/// # Example
///
/// ```
/// use machiavelli::table::*;
/// use machiavelli::sequence_cards::*;
///
/// let mut table_1 = Table::new();
/// table_1.add(Sequence::from_cards(&[
///     RegularCard(Club, 4), 
///     RegularCard(Club, 5), 
///     RegularCard(Club, 6), 
/// ]));
/// table_1.add(Sequence::from_cards(&[
///     RegularCard(Club, 2), 
///     RegularCard(Club, 3), 
///     RegularCard(Club, 4), 
/// ]));
///
/// let mut table_2 = Table::new();
/// table_2.add(Sequence::from_cards(&[
///     RegularCard(Club, 4), 
///     RegularCard(Club, 5), 
///     RegularCard(Club, 6), 
/// ]));
/// table_2.add(Sequence::from_cards(&[
///     RegularCard(Club, 2), 
///     RegularCard(Club, 3), 
///     RegularCard(Club, 4), 
///     RegularCard(Club, 5), 
/// ]));
/// 
/// let hm_cards_1 = table_1.count_cards();
/// let hm_cards_2 = table_2.count_cards();
///
/// assert_eq!(true, table_2.contains_hm(&hm_cards_1));
/// assert_eq!(false, table_1.contains_hm(&hm_cards_2));
/// ```
Determine whether a table contains all the cards in a hashmap
Determine whether a table contains all the cards in a hashmap
pub fn contains_hm(&self, card_count: &HashMap<Card, u16>) -> bool {
        let card_count_self = self.count_cards();
        for (card, count) in card_count {
            if !card_count_self.contains_key(&card) {
                return false;
            }
            if card_count_self[&card] < *count {
                return false;
            }
        }
        true
    }
pub fn contains_hm ( & self , card_count : & HashMap < Card , u16 > ) -> bool { let card_count_self = self . count_cards ( ) ; for ( card , count ) in card_count { if ! card_count_self . contains_key ( & card ) { return false ; } if card_count_self [ & card ] < * count { return false ; } } true }
Determine whether a table contains all the cards in a hashmap
Determine whether a table contains all the cards in a hashmap
&self
card_count
&HashMap<Card, u16>
&self
card_count
&HashMap<Card, u16>
example
```
use machiavelli::table::*;
use machiavelli::sequence_cards::*.

let mut table_1 = Table::new();
table_1.add(Sequence::from_cards(&[
RegularCard(Club, 4),
RegularCard(Club, 5),
RegularCard(Club, 6),
]));
table_1.add(Sequence::from_cards(&[
RegularCard(Club, 2),
RegularCard(Club, 3),
RegularCard(Club, 4),
])).

let mut table_2 = Table::new();
table_2.add(Sequence::from_cards(&[
RegularCard(Club, 4),
RegularCard(Club, 5),
RegularCard(Club, 6),
]));
table_2.add(Sequence::from_cards(&[
RegularCard(Club, 2),
RegularCard(Club, 3),
RegularCard(Club, 4),
RegularCard(Club, 5),
])).

let hm_cards_1 = table_1.count_cards();
let hm_cards_2 = table_2.count_cards().

assert_eq!(true, table_2.contains_hm(&hm_cards_1));
assert_eq!(false, table_1.contains_hm(&hm_cards_2));
```
` ` ` use machiavelli :: table :: * ; use machiavelli :: sequence_cards :: * . let mut table_1 = Table :: new () ; table_1 . add ( Sequence :: from_cards ( & [ RegularCard ( Club 4 ) RegularCard ( Club 5 ) RegularCard ( Club 6 ) ] )) ; table_1 . add ( Sequence :: from_cards ( & [ RegularCard ( Club 2 ) RegularCard ( Club 3 ) RegularCard ( Club 4 ) ] )) . let mut table_2 = Table :: new () ; table_2 . add ( Sequence :: from_cards ( & [ RegularCard ( Club 4 ) RegularCard ( Club 5 ) RegularCard ( Club 6 ) ] )) ; table_2 . add ( Sequence :: from_cards ( & [ RegularCard ( Club 2 ) RegularCard ( Club 3 ) RegularCard ( Club 4 ) RegularCard ( Club 5 ) ] )) . let hm_cards_1 = table_1 . count_cards () ; let hm_cards_2 = table_2 . count_cards () . assert_eq! ( true table_2 . contains_hm ( &hm_cards_1 )) ; assert_eq! ( false table_1 . contains_hm ( &hm_cards_2 )) ; ` ` `