summaryrefslogtreecommitdiffstats
path: root/kpat/deck.h
blob: eb13268ce9d6681eeb8538cef09a6b1eb839202d (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
#ifndef _DECK_H_
#define _DECK_H_

#include "pile.h"
class dealer;

/***************************************

  Deck (Pile with id 0) -- create and shuffle 52 cards

**************************************/
class Deck: public Pile
{

private:
    Deck( Dealer* tqparent = 0, int m = 1, int s = 4 );
    virtual ~Deck();

public:
    static Deck *new_deck( Dealer *tqparent = 0, int m = 1, int s = 4 );
    static Deck *deck() { return my_deck; }

    static const long n;

    void collectAndShuffle();

    Card* nextCard();

    uint decksNum() const { return mult; }

private: // functions

    void makedeck();
    void addToDeck();
    void shuffle();

private:

    uint mult;
    uint suits;
    Card** _deck;

    static Deck *my_deck;
};

#endif