pub fn into_inner(self) -> Vec<u32> {
self.0.into_iter().map(|c| c.into_inner()).collect()
}
+
+ pub fn as_vec_card(&self) -> &Vec<Card> {
+ &self.0
+ }
}
impl FromStr for Cards {
impl From<Cards> for Vec<u32> {
fn from(c: Cards) -> Self {
- c.0.into_iter().map(|c| c.into_inner()).collect()
+ Vec::from(c.into_inner())
}
}
self.0
}
+ pub fn as_cards(&self) -> &Cards {
+ &self.0
+ }
+
pub fn deal_with_rules(&mut self, rules: &Rules) -> Result<Cards, MyError> {
let v = match rules {
Rules::Classic => self.deal(5)?,
self.0
}
+ pub fn as_u32(&self) -> u32 {
+ self.0
+ }
+
pub fn suit(&self) -> char {
match (self.0 >> 12) & 0xF {
0b1000 => 'c',