ReactOS  0.4.15-dev-5097-g328cc41
CardCount Class Reference

#include <cardcount.h>

Collaboration diagram for CardCount:

Public Member Functions

 CardCount ()
 
 CardCount (const CardStack &cs)
 
void Init (const CardStack &cs)
 
void Clear ()
 
void Add (const CardStack &cs)
 
void Sub (const CardStack &cs)
 
void Dec (size_t index)
 
int operator[] (size_t index) const
 
CardCountoperator= (const CardStack &cs)
 
CardCountoperator+= (const CardStack &cs)
 

Private Attributes

int count [13]
 

Detailed Description

Definition at line 4 of file cardcount.h.

Constructor & Destructor Documentation

◆ CardCount() [1/2]

CardCount::CardCount ( )

Definition at line 25 of file cardcount.cpp.

26 {
27  Clear();
28 }
void Clear()
Definition: cardcount.cpp:35

◆ CardCount() [2/2]

CardCount::CardCount ( const CardStack cs)

Definition at line 30 of file cardcount.cpp.

31 {
32  Init(cs);
33 }
uint32_t cs
Definition: isohybrid.c:75
void Init(const CardStack &cs)
Definition: cardcount.cpp:64

Member Function Documentation

◆ Add()

void CardCount::Add ( const CardStack cs)

Definition at line 41 of file cardcount.cpp.

42 {
43  for(int i = 0; i < cs.NumCards(); i++)
44  {
45  Card card = cs[i];
46 
47  int val = card.LoVal();
48  count[val - 1]++;
49  }
50 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
uint32_t cs
Definition: isohybrid.c:75
GLuint GLfloat * val
Definition: glext.h:7180
Definition: card.h:27
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int LoVal() const
Definition: card.h:59

Referenced by Init().

◆ Clear()

void CardCount::Clear ( )

Definition at line 35 of file cardcount.cpp.

36 {
37  for(int i = 0; i < 13; i++)
38  count[i] = 0;
39 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by CardCount(), and Init().

◆ Dec()

void CardCount::Dec ( size_t  index)

Definition at line 82 of file cardcount.cpp.

83 {
84  if(index < 1) return;
85  else if(index > 14) return; //if out of range
86  else if(index == 14) index = 1; //if a "ace-high"
87 
88  index -= 1;
89 
90  if(count[index] > 0)
91  count[index]--;
92 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint index
Definition: glext.h:6031
#define index(s, c)
Definition: various.h:29

◆ Init()

void CardCount::Init ( const CardStack cs)

Definition at line 64 of file cardcount.cpp.

65 {
66  Clear();
67  Add(cs);
68 }
uint32_t cs
Definition: isohybrid.c:75
void Add(const CardStack &cs)
Definition: cardcount.cpp:41
void Clear()
Definition: cardcount.cpp:35

Referenced by CardCount().

◆ operator+=()

◆ operator=()

◆ operator[]()

int CardCount::operator[] ( size_t  index) const

◆ Sub()

void CardCount::Sub ( const CardStack cs)

Definition at line 52 of file cardcount.cpp.

53 {
54  for(int i = 0; i < cs.NumCards(); i++)
55  {
56  Card card = cs[i];
57  int val = card.LoVal();
58 
59  if(count[val - 1] > 0)
60  count[val - 1]--;
61  }
62 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
uint32_t cs
Definition: isohybrid.c:75
GLuint GLfloat * val
Definition: glext.h:7180
Definition: card.h:27
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int LoVal() const
Definition: card.h:59

Member Data Documentation

◆ count

int CardCount::count[13]
private

Definition at line 23 of file cardcount.h.


The documentation for this class was generated from the following files: