Blackjack
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Deck Class Reference

#include <deck.h>

Public Member Functions

 Deck ()
 Initialize the deck of cards.
 
void print () const
 
void shuffle ()
 Shuffle the deck.
 
const CarddealCard ()
 Deal a card (the top one) from the deck.
 

Constructor & Destructor Documentation

◆ Deck()

Deck::Deck ( )

Initialize the deck of cards.

Create 52 cards to initialize the deck

Member Function Documentation

◆ print()

void Deck::print ( ) const

◆ shuffle()

void Deck::shuffle ( )

Shuffle the deck.

  • Uses a Mersenne Twister to arrange the deck in a random order
  • Sets m_cardIndex to 0.

◆ dealCard()

const Card & Deck::dealCard ( )

Deal a card (the top one) from the deck.

Returns
const Card&: a constant reference to the dealt card
  • Deals a card pointed to by m_cardIndex

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