Mari's Tarot
 All Classes Files Functions Variables Enumerations Enumerator Friends
Public Member Functions | Public Attributes | List of all members
Deck Class Reference

Deck is the class managing the deck of cards. Used as well as for the game deck, but also for a counting cards AI. More...

#include <Deck.hpp>

Collaboration diagram for Deck:
Collaboration graph

Public Member Functions

 Deck ()
 The unique constructor of Deck. More...
 
bool hasStrongerThan (const shared_ptr< Card > card) const
 Tests if the current deck has a stronger card than to proposed one. More...
 
int indexInDeck (const shared_ptr< Card > card) const
 indexInDeck returns the index of a card in the deck. More...
 
void newDeal ()
 Make a new deal; create each card of the game. More...
 
void shuffle ()
 Calls random_shuffle from the algorithm library. More...
 

Public Attributes

vector< shared_ptr< Card > > cards
 The vector of all cards in the deck. More...
 
vector< shared_ptr< Card > > heads
 The vector of head cards (useful calling a card for 5-players games). More...
 
int numberHearts
 The number of Hearts in the deck. More...
 
int numberSpades
 The number of Spades in the deck. More...
 
int numberDiamonds
 The number of Diamonds in the deck. More...
 
int numberClubs
 The number of Clubs in the deck. More...
 
int numberTrumps
 The number of Trumps in the deck. More...
 

Detailed Description

Deck is the class managing the deck of cards. Used as well as for the game deck, but also for a counting cards AI.

Constructor & Destructor Documentation

Deck::Deck ( )

The unique constructor of Deck.

Member Function Documentation

bool Deck::hasStrongerThan ( const shared_ptr< Card card) const

Tests if the current deck has a stronger card than to proposed one.

Parameters
cardA pointer of Card.
Returns
True iff the deck has a stronger card than the input.
int Deck::indexInDeck ( const shared_ptr< Card card) const

indexInDeck returns the index of a card in the deck.

Parameters
cardA pointer of Card.
Returns
The index of card in the Deck, or -1 if the deck does not contain it.
void Deck::newDeal ( )

Make a new deal; create each card of the game.

void Deck::shuffle ( )

Calls random_shuffle from the algorithm library.

Member Data Documentation

vector< shared_ptr<Card> > Deck::cards

The vector of all cards in the deck.

vector< shared_ptr<Card> > Deck::heads

The vector of head cards (useful calling a card for 5-players games).

int Deck::numberClubs

The number of Clubs in the deck.

int Deck::numberDiamonds

The number of Diamonds in the deck.

int Deck::numberHearts

The number of Hearts in the deck.

int Deck::numberSpades

The number of Spades in the deck.

int Deck::numberTrumps

The number of Trumps in the deck.


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