#include <deck.h>
Public Member Functions | |
| Deck (long seed, QObject *parent) | |
| Constructor for the deck. | |
| virtual | ~Deck () |
| Destructor. | |
| int | cardNumber () |
| Retrieve number of cards in this deck. | |
| void | shuffle () |
| Shuffle the cards and reset the pile. | |
| Suite | randomTrump () |
| Draw a random trump from all cards. | |
| int | drawCard () |
| Draw a random card out of the pile of existing ones. | |
Static Public Member Functions | |
| static Suite | getSuite (int card) |
| Get the suite (Club, . | |
| static CardType | getCardType (int card) |
| Get the card type (ace, king, . | |
| static int | getCardValue (int card) |
| Get the value in points of the given card (number). | |
| static QString | name (Suite suite, CardType type) |
| Returns a verbose name for a card. | |
| static QString | name (int card) |
| Returns a verbose name for a card. | |
Definition at line 50 of file deck.h.
|
||||||||||||
|
Constructor for the deck.
Definition at line 38 of file deck.cpp. References shuffle(). Here is the call graph for this function: ![]() |
|
|
Destructor.
|
|
|
Retrieve number of cards in this deck.
Definition at line 52 of file deck.cpp. Referenced by AbstractDisplay::createCardSprites(). |
|
|
Draw a random card out of the pile of existing ones.
Definition at line 91 of file deck.cpp. Referenced by Player::deal(). |
|
|
Get the card type (ace, king, . ..) of a given card (number)
Definition at line 110 of file deck.cpp. Referenced by getCardValue(), EngineTwo::isLegalMove(), name(), EngineTwo::playerInput(), randomTrump(), and EngineTwo::whoWonMove(). |
|
|
Get the value in points of the given card (number).
Definition at line 117 of file deck.cpp. References CardDeck::Ace, getCardType(), CardDeck::Jack, CardDeck::King, CardDeck::Queen, and CardDeck::Ten. Referenced by Player::addWonCard(). Here is the call graph for this function: ![]() |
|
|
Get the suite (Club, . ..) of a given card (number)
Definition at line 103 of file deck.cpp. Referenced by EngineTwo::isLegalMove(), name(), EngineTwo::playerInput(), randomTrump(), and EngineTwo::whoWonMove(). |
|
|
Returns a verbose name for a card.
Definition at line 130 of file deck.cpp. References getCardType(), getSuite(), and name(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Returns a verbose name for a card.
Definition at line 138 of file deck.cpp. References CardDeck::Ace, CardDeck::Club, CardDeck::Diamond, CardDeck::Eight, CardDeck::Grand, CardDeck::Heart, CardDeck::Jack, CardDeck::King, CardDeck::Nine, CardDeck::Queen, CardDeck::Seven, CardDeck::Spade, and CardDeck::Ten. Referenced by name(), and EngineTwo::playerInput(). |
|
|
Draw a random trump from all cards. This is done by drawing a random card and choosing its suite as trump. In case a Jack is drawn a Grand is made trump.
Definition at line 59 of file deck.cpp. References getCardType(), getSuite(), CardDeck::Grand, CardDeck::Jack, and NUMBER_OF_CARDS. Referenced by Mainwindow::startGame(). Here is the call graph for this function: ![]() |
|
|
Shuffle the cards and reset the pile.
Definition at line 71 of file deck.cpp. References NUMBER_OF_CARDS. Referenced by Deck(), and Mainwindow::startGame(). |
1.4.6