added utils

This commit is contained in:
clizia 2025-01-07 20:01:32 +01:00
parent 30d55ecacb
commit e4b5725c66
2 changed files with 12 additions and 0 deletions

View file

@ -19,4 +19,12 @@ impl Card {
value,
}
}
pub fn get_suit(self) -> Suit {
self.suit
}
pub fn get_value(self) -> u8 {
self.value
}
}

View file

@ -30,6 +30,10 @@ impl Deck {
}
}
pub fn get_deck(self) -> Vec<Card> {
self.deck
}
pub fn shuffle(mut self) -> Deck {
let mut rng = rng();
self.deck.shuffle(&mut rng);