cribbage_core/hand/crib_cards.rs
1use crate::card::Card;
2use crate::hand::Hand;
3
4pub struct CribCards {
5 cards: [Card; 4],
6}
7
8impl CribCards {
9 pub(in crate::hand) fn new(cards: [Card; 4]) -> CribCards {
10 CribCards { cards }
11 }
12
13 pub fn add_cut_card(self, cut: Card) -> Hand {
14 Hand::new(self.cards, cut, true)
15 }
16
17 pub fn cards(&self) -> &[Card] {
18 &self.cards
19 }
20}