summaryrefslogtreecommitdiffstats
path: root/user.cpp
blob: 9903412f41a43257093ba71b57998ba1515ef9b9 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * user.cpp
 *
 *
 */

#include "user.h"

User::User(void) : whatHand(9)
{

}

void User::dealUserCards(void)
{
    /* the cards will be dealt from end of the deck array using deckCurrIndex */
    int i;
    for (i = 0; i < 5; i++)
        userCards[i] = PopCardFromDeck();
}

void User::printUserCards(void)
{
    int i;
    for (i = 0; i < 5; i++)
        if (userCards[i])
        cout << i+1 << ") " << userCards[i]->getType() << " ";
    cout << endl << endl;
}

void User::sortUserCards(void)
{
    sortCards(userCards);
}

void User::discardCards(void)
{
    cout << "List the cards' numbers you wish to discard: ";
}

Card **User::getUserCards(void)
{
    return userCards;
}

void User::setUserHand(int hand)
{
    whatHand = hand;
}

int User::getUserHand(void)
{
    return whatHand;
}