//*****************************************************************************
// 
// Blackjack - an X windows program of the casino game.
// Copyright (C) 1997  Tom Daley 
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// 
// The license is in the file COPYING.
// 
// Tom Daley
// 1309 W. Lorraine Ave.
// Woodland Park, CO  80863-2329
// 
// daley@codenet.net (Tom Daley)
// http://users.codenet.net/daley
// 
//*****************************************************************************

#ifndef _HAND_INCLUDED_
#define _HAND_INCLUDED_

#include <qlist.h>
#include "card.h"

//*****************************************************************************

class Hand {
   private:
      int  _soft_flag;
      int  _value;
      QList <Card>_cards;
      float _bet;
      float _insurance_bet;
      void  calculateValue(void);
   public:
      Hand() : _soft_flag(0), _bet(0.0), _insurance_bet(0.0) { }
      void addCard(Card *cp) { _cards.append(cp); calculateValue(); }
      void setBet(float bet) { _bet = bet; }
      float getBet(void) { return(_bet); }
      void setInsuranceBet(float bet) { _insurance_bet = bet; }
      float getInsuranceBet(void) { return(_insurance_bet); }
      void clear(void) { _cards.clear(); }
      Card *removeCard(void);
      void setAllCardsUp(void);
      int  isSoft(void) { return(_soft_flag); }
      int  isSplitable(void);
      int  value(void) { return(_value); }
      int  numCards(void) { return (_cards.count()); }
      QString getHelpIndex(void);
      Card *getCard(int card_num) { return (_cards.at(card_num)); }
      void draw(QPaintDevice *device_p, int x, int y);
};
    
#endif

//*****************************************************************************
