card: new card constructor

This commit is contained in:
2026-04-01 05:47:28 +01:00
committed by oreodave
parent b6b54300c2
commit 2356d78592

View File

@@ -36,6 +36,14 @@ impl Rank {
}
impl Card {
pub fn new(rank: Rank, suit: Suit) -> Self {
Self::PlayingCard {
deck: 0,
rank,
suit,
}
}
pub fn is_joker(&self) -> bool {
matches!(self, Self::Joker(_))
}