summaryrefslogtreecommitdiffstats
path: root/sorthand.cpp
blob: 8445e7f1812fa8a15c49e86c5db7f092879b0028 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * sorthand.cpp
 *
 *
 */

#include "sorthand.h"

SortHand::SortHand()
{

}

void sortFourOfAKind(Card **cards, struct countAndType *maxCount)
{
    int i;
    /* find the card that is different from other four */
    for (i = 0; i < 5; i++)
        if (cards[i]->getRank() != maxCount->type)
            break;

#ifdef DEBUG
    cout << ANSI_COLOR_CYAN << "\ndebug: sortFourOfAKind(): " << cards[i]->getType()
         << " is different from other 4 cards" << endl << ANSI_COLOR_RESET;
#endif

    /* put that card at the end */
    Card *tmp = cards[i];

    cards[4] = cards[i];
    cards[i] = tmp;
}

void sortFullHouse(Card **cards, struct countAndType *threeCount)
{

}