#ifndef DEALER_H
#define DEALER_H

#include <deck.h>
#include <hand.h>

typedef unsigned int uint;
typedef unsigned int const uintc;

/*!
\brief The dealer is a player with special powers.

This class is written from the perspective of the 
 dealer.

Additional simulation functions were added for 
 experimentation to determine probabilities of win or loss.
*/
class dealer
{
public:

  /** The deck of cards. */
  deck & cards;
  /** The dealer has a hand to play agains the players. */
  hand hnd;

  /** The dealer sees and needs a deck of cards. */
  dealer(deck & _cards)
    : cards(_cards) {}

  /** The dealers hand is played from the hnd state.  
      This is independent of any player. */
  void play();

  /** -1 is a loss for the player
       0 is a draw
       1 is a win to the player */
  int const playAgainst( uintc player, uintc dealer0 ); 

  /** Simulate the dealer playing against a player where both
      the dealer and the player have set hands. */
  void playAgainst
  (
    double & prPlayerLoss,
    double & prDraw,
    double & prPlayerWin,
    long unsigned int n,
    uintc player, 
    uintc dealer0 
  );

};


#endif


