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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.