dealhand.cpp

// Dealers hand body
// Brandon Goldfedder

#include "dealhand.h"
#include "display.h"

StandardDealerHand::StandardDealerHand(Displayer *displayer): 
StandardBlackJackHand(displayer)
{
}

StandardDealerHand::~StandardDealerHand()
{
}

BlackJackHand::TURN_RESULT StandardDealerHand::TakeTurn()
{
   TURN_RESULT result = STAND;
   if (HighCount() < 17)
      result = HIT;
   else if (HighCount() > 21)
      result = BUST;
   GetDisplayer()->DisplayTurn(*this, result);
   return result;
}

const char* const StandardDealerHand::GetIdentity() const
{
   return "Dealer"; // should ensure static allocation
}


unsigned int StandardDealerHand::NumCardsDealtDown() const
{
   return 1;
}

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.