CardProperties Class Reference
#include <cardproperties.h>
List of all members.
Detailed Description
This is designed to determine the unique properties of a sequence of cards.
- Author:
- John Schneiderman
Member Enumeration Documentation
These are the rules used to determine what patterns constitutes something in a sequence of cards.
- Parameters:
-
| SINGLETON | is when in the sequence you only have one card in a suit. |
| DOUBLETON | is when in the sequence you only have two cards in a suit. |
| PAIR | is when in the sequence you have cards of the same rank. |
| RUN | is when in the sequence you have cards increasing in sequence by one. |
| FLUSH | is when in the sequence you have cards of the same suit. |
These are all the public constants.
- Parameters:
-
| MAXIMUM_SEQUENCE_SIZE | is the largest sequence we can reasonably parse. |
Constructor & Destructor Documentation
CardProperties::CardProperties |
( |
|
) |
|
CardProperties::CardProperties |
( |
const CardSequence & |
sequence |
) |
|
This constructor is used to start off with a card sequence.
- Parameters:
-
| sequence | is the card sequence you wish to determine the properties of. |
- Exceptions:
-
| KardsGTError | if the sequence size is too large to reasonably parse. |
Member Function Documentation
vector< CardSequence > CardProperties::combinations |
( |
|
) |
const |
This gives all the combinations of the sequence we're examining.
- Returns:
- the card combinations for the sequence.
This goes through our sequence and finds all doubletons.
- Returns:
- all doubletons found in the sequence of cards.
This goes through our sequence and finds all the unique flushes.
- Returns:
- the largest unique flushes that can be found in the sequence of cards.
This goes through our sequence and finds all pairs.
- Returns:
- each unique pair that is found in the sequence of cards.
This goes through the card sequence and arranges them according to a binary ordering.
For example: QS, KS, JS would return the following combinations:
JS
QS
QS JS
KS
KS JS
KS QS
KS QS JS
- Parameters:
-
| seq | is the card sequence to parse and expand, generating the combinations. |
- Returns:
- an array filled with all possible unique combinations for the card sequence.
This goes through our sequence and finds all the cards of a specific rank.
- Parameters:
-
| rank | is the rank we're looking for. |
- Returns:
- all the suits that match the rank we want.
This goes through our sequence and finds all the unique runs.
- Returns:
- the longest unique runs found in the sequence of cards.
This gives you the sequence that we're examining.
- Returns:
- the card sequence that we're examining.
void CardProperties::setSequence |
( |
const CardSequence & |
sequence |
) |
|
This sets the sequence of cards you want to examine.
- Parameters:
-
| sequence | is the sequence of cards you want to examine. |
- Exceptions:
-
| KardsGTError | if the sequence size is too large to reasonably parse. |
vector< Card > CardProperties::singletons |
( |
|
) |
const |
This goes through our sequence and finds all singletons.
- Returns:
- all singletons found in the sequence of cards.
This goes through our sequence and finds all the cards of a specific suit.
- Parameters:
-
| suit | is the suit we're looking for. |
- Returns:
- all the suits that match the suit we want.
This goes through our sequence and finds all combinations whose sum equals a specified value.
- Parameters:
-
| goal | is the value you aspire to combine to using the sequence of cards. |
| rules | is the specific rules for the card game being played. |
- Returns:
- the unique combinations that sum up to goal.
vector< CardSequence > CardProperties::uniqueSequences |
( |
const vector< CardSequence > & |
examineSequence |
) |
const [protected] |
Searches through and finds all unique sequences.
- Note:
- A unique sequence is a sequence that has a card that is not in any of the other sequences.
- Parameters:
-
| examineSequence | is the sequences to examine. |
- Returns:
- the unique sequences found.
The documentation for this class was generated from the following files:
- gamebase/cardproperties.h
- gamebase/cardproperties.cpp