ReactOS  0.4.13-dev-455-g28ed234
cardstack.h
Go to the documentation of this file.
1 #ifndef CARDSTACK_INCLUDED
2 #define CARDSTACK_INCLUDED
3 
4 #define MAX_CARDSTACK_SIZE 128
5 
6 class CardStack
7 {
8  friend class CardRegion;
9 
10 public:
11  CardStack() : nNumCards(0) { }
12 
13  void NewDeck();
14  int NumCards() const { return nNumCards; }
15  void Shuffle();
16  void Clear();
17  void Reverse();
18 
19  void Push(const Card card);
20  void Push(const CardStack &cardstack);
21 
22  Card Pop();
23  CardStack Pop(int items);
24 
25  Card Top();
26  CardStack Top(int items);
27 
28  void Print();
29 
30  Card RemoveCard(size_t index);
31  void InsertCard(size_t index, Card card);
32 
33  //subscript capability!!
34  Card & operator[] (size_t index);
35  const Card & operator[] (size_t index) const;
36 
39 
42 
43 private:
44 
45  CardStack(CardStack &copythis, size_t fromindex);
46 
48  int nNumCards;
49 };
50 
51 #endif /* CARDSTACK_INCLUDED */
52 
void Print()
Definition: cardstack.cpp:222
CardStack cardstack
Definition: cardregion.h:143
Card cardlist[MAX_CARDSTACK_SIZE]
Definition: cardstack.h:47
void Clear()
Definition: cardstack.cpp:37
void InsertCard(size_t index, Card card)
Definition: cardstack.cpp:192
void Push(const Card card)
Definition: cardstack.cpp:83
Card RemoveCard(size_t index)
Definition: cardstack.cpp:172
CardStack()
Definition: cardstack.h:11
Card Top()
Definition: cardstack.cpp:151
uint32_t cs
Definition: isohybrid.c:75
void NewDeck()
Definition: cardstack.cpp:42
void Reverse()
Definition: cardstack.cpp:73
GLuint index
Definition: glext.h:6031
int nNumCards
Definition: cardstack.h:48
void Shuffle()
Definition: cardstack.cpp:50
Card Pop()
Definition: cardstack.cpp:127
#define MAX_CARDSTACK_SIZE
Definition: cardstack.h:4
CardStack & operator+=(Card card)
Definition: cardstack.cpp:100
Definition: card.h:27
Card & operator[](size_t index)
Definition: cardstack.cpp:10
CardStack operator+(Card card)
Definition: cardstack.cpp:112
static TCHAR * items[]
Definition: page1.c:45
int NumCards() const
Definition: cardstack.h:14