deck.cpp

 // Deck body // Brandon Goldfedder #include <algorithm> #include "deck.h" Deck::Deck() { } Deck::~Deck() { } void Deck::BurnIt() { actualDeck.erase(actualDeck.begin(), actualDeck.end()); } void Deck::AddDeck(unsigned int numDecks) { const unsigned int NUMVALUES = 13; const unsigned int NUMSUITS = 4; const char cardValues[NUMVALUES] = {'A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K'}; const Card::SUIT suitValues[NUMSUITS] = { Card::HEART, Card::DIAMOND, Card::SPADE, Card::CLUB}; Card crd; for (int count = 0; count < numDecks; count++) { for (int i = 0; i < NUMSUITS; i++) { crd.SetSuit(suitValues[i]); for (int j = 0; j < NUMVALUES; j++) { crd.SetType(cardValues[j]); actualDeck.push_back(crd); } } } } void Deck::Shuffle() ...

Get Joy of Patterns: Using Patterns for Enterprise Development, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.