simhand.cpp

// Simulated Player hand body
// Brandon Goldfedder

#include <string.h>
#include "simhand.h"
#include "display.h"

SimulatedPlayerHand::SimulatedPlayerHand(const char* name,
      Displayer *displayer): StandardBlackJackHand(displayer)
{
   id = new char[strlen(name) + 1];
   strcpy(id, name);
}
SimulatedPlayerHand::~SimulatedPlayerHand()
{
   delete[] id;
}

const char* const SimulatedPlayerHand::GetIdentity() const
{
   return id;
}

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

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.58.179