O'Reilly logo

Joy of Patterns: Using Patterns for Enterprise Development, The by Brandon Goldfedder

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

dealer.h

 // Dealer header // Brandon Goldfedder #include <list> #include "bjhand.h" #include "deck.h" inline void destroy(BlackJackHand**) {} // Needed due to an STL issue class Dealer { public: enum STATUS {BLACKJACK, WIN, LOSE, PUSH}; // BLACKJACK becomes WIN or PUSH if dealer has bj Dealer(unsigned int numDecks, unsigned int cutCardPosition); ~Dealer(); void AssignPlayerHand(BlackJackHand* hand); void SetDealerHand(BlackJackHand* hand); void NewShoe(); void Play(); STATUS GetPlayerStatus(const BlackJackHand* hand) const; // Hand must be in set to be valid private: const unsigned int numDecks; const unsigned int cutCardPosition; bool DealCard(BlackJackHand* hand); bool ProcessTurn(BlackJackHand* hand); // returns true if player still in there ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required