summaryrefslogtreecommitdiffstats
path: root/cardpile.h
blob: 25f0132593b0abd3469bc66b220291721e36fba2 (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
#ifndef _CARDPILE_H_
#define _CARDPILE_H_

#include "card.h"
#include <iostream>
#include <string>

using std::cout;
using std::endl;
using std::string;

struct countAndSuit
{
    enum Suit whatSuit;
    int count;
};

struct countAndType
{
    char type;
    int count;
};

class CardPile : public Card
{
    private:
        /* draw pile */
        Card *deck[52];
        int deckCurrIndex;

        /* discard pile */
        Card *discardPile[52];
        int discardPileCurrIndex;

    protected:

    public:
        CardPile(void);
        ~CardPile(void);

        Card getCard(int);
        void printPile(void);

        /* used by sorting algorithm to peek at the card or to assign new card */
        Card *getCardFromDeck(int);
        void putCardToDeck(int, Card *);

        void putCardToDiscardPile(Card *);
        Card *PopCardFromDeck(void);
        void resetDeck(void);
};

#endif