Working on refactoring winning.
This commit is contained in:
@ -45,6 +45,11 @@ namespace Dawn {
|
||||
|
||||
static void fillDeck(std::vector<struct Card> *deck);
|
||||
static void shuffle(std::vector<struct Card> *deck);
|
||||
static bool_t contains(std::vector<struct Card> *deck, struct Card);
|
||||
static std::vector<struct Card> countPairs(
|
||||
std::vector<struct Card> *deck,
|
||||
enum CardValue value
|
||||
);
|
||||
|
||||
/**
|
||||
* Sort a hand of cards. Cards are ordered in descending weight, aces are
|
||||
@ -58,9 +63,12 @@ namespace Dawn {
|
||||
Card(CardSuit suit, CardValue num) :
|
||||
cardValue((suit * CARD_COUNT_PER_SUIT) + num)
|
||||
{
|
||||
assertTrue(suit < CARD_SUIT_COUNT);
|
||||
assertTrue(num < CARD_COUNT_PER_SUIT);
|
||||
}
|
||||
|
||||
Card(uint8_t cv) : cardValue(cv) {
|
||||
assertTrue(cv < CARD_DECK_SIZE);
|
||||
}
|
||||
|
||||
CardValue getValue() {
|
||||
|
Reference in New Issue
Block a user