#ifndef _HAND
#define _HAND

#include <windows.h>
#include <string.h>
#include "card.h"

#define TWO_CARD		0
#define FIVE_CARD 	1
#define SEVEN_CARD	2

#define DEALER 0
#define PLAYER 1

#define PLAYER_RIGHTBOX	1
#define PLAYER_LEFTBOX	80
#define PLAYER_TOPBOX		195
#define PLAYER_BOTTOMBOX	305

#define PLAYER_TWOHANDTOP 200
#define PLAYER_FIVEHANDTOP 200
#define PLAYER_DESC PLAYER_BOTTOMBOX + 10

#define DEALER_RIGHTBOX	1
#define DEALER_LEFTBOX	(DEALER_RIGHTBOX + 79)
#define DEALER_TOPBOX		45
#define DEALER_BOTTOMBOX	(DEALER_TOPBOX + 100)

#define DEALER_TWOHANDTOP 45
#define DEALER_FIVEHANDTOP 45
#define DEALER_DESC DEALER_BOTTOMBOX + 10

#define HAND_DATALEN (int)(&end_of_hand_data - &start_of_hand_data + 1)

class Hand
{
   public:
      Card  card[7];
      
      char start_of_hand_data;   //place holder for initialization

      int   type;          //is this a 2, 5 or 7 card hand
      int   hand_type;     //high card, pair, two pair, etc...
      int   who;           //PLAYER or DEALER
      int   first_pair;    //value of first_pair
      int   high_card;     //value of high card
      int   second_pair;
      int   three_of_what;
      int   four_of_what;
      int   five_of_what;
      int   baby;				// for baby straights and straight flushes

      int numbers[15];     //holds a count of each card value in hand (i.e. if player has 3 deuces then numbers[1] = 3)
      int number_of_hearts;
      int number_of_spades;
      int number_of_diamonds;
      int number_of_clubs;
      int consecutive_cards;
      int most_consecutive_cards;
      int high_consecutive_card;
      int low_consecutive_card;
      int have_four_of_a_kind;
      int have_four_of_what;
      int three_of_a_kinds[2];
      int number_of_three_of_a_kinds;
      int pairs[3];
      int number_of_pairs;
      int have_ace;                 //may be able to get rid of this value
      int have_king;                //may be able to get rid of this value
      int have_straight;
      int have_baby_straight;
      int type_of_flush;
      int number_of_same_suit;

      char end_of_hand_data;   //place holder for initialization

      Hand(int, int);
      void  Describe(HDC, short, short);
      void  Parse(void);
      int   operator>(Hand &);
      int  operator < (Hand &);
      void  SwapCards(Card *, Card *);
      void  Sort(void);
      int  Check(Hand *);
      void  Show(HDC, short, short, int);
};

extern HANDLE hInst;
extern HBITMAP hBitmap;

#endif

