summaryrefslogtreecommitdiffstats
path: root/kpat/deck.h
blob: f5239fe0baee7986a71e3476e657c5cbc5afbb89 (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* parent = 0, int m = 1, int s = 4 );
    virtual ~Deck();

public:
    static Deck *new_deck( Dealer *parent = 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