home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / PROGRAM / WTJ9403.ZIP / POKER / POKERDOC.H < prev    next >
C/C++ Source or Header  |  1994-01-31  |  3KB  |  81 lines

  1. // pokerdoc.h : interface of the CPokerDoc class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4.  
  5. class CPokerDoc : public CDocument
  6. {
  7. protected: // create from serialization only
  8.     CPokerDoc();
  9.     DECLARE_DYNCREATE(CPokerDoc)
  10.  
  11. // Attributes
  12. public:
  13.  
  14. // Operations
  15. public:
  16.  
  17. // Variables
  18.  
  19.     int        nCurrentBack;    // Which card back the user is seeing.
  20.     int        nBackAnimate;    // State of back animation. 0 is normal back.
  21.     int        nAnimateCard;    // Which (of dealer's) card is being animated.
  22.     int        nAnimationCounter;    // Controls the animation of the dealer's card backs.
  23.     int        bFace[NUMBER_PLAYERS];        // Force display of face of card.
  24.     int        nHand[NUMBER_PLAYERS][5];    // Each (of four) player's hand.
  25.     int        nCurrentCard;    // Which card (or back) is being displayed.
  26.     int        nDeck[52];        // The current deck of cards.
  27.     int        nTimer;            // Animate card back timer ID.
  28.     int     nHeight;        // Height of a card.
  29.     int        nWidth;            // Width of a card.
  30.     int        nPot;            // The current pot.
  31.     int        nOwed[NUMBER_PLAYERS];        // Amount each player owes to the pot
  32.     int        nChips[NUMBER_PLAYERS];        // Each player's current holdings (in $5 chips)
  33.     int        nPlaying[NUMBER_PLAYERS];    // TRUE if this player is currently playing...
  34.     CPoint    CardLocation[NUMBER_PLAYERS][5];    // Location of each player's card
  35.     int        nCardState[NUMBER_PLAYERS][5];    // State of each card (OK, Selected for discard...)
  36.     int     nCurrentPlayer; // Who's turn it is...
  37.     int        nOldCurrentPlayer;     // Who was first to go, last round...
  38.     int        nPlayerAction[NUMBER_PLAYERS];    // What the player did, last round.
  39.     int        nPlayerBet[NUMBER_PLAYERS];    // The amount this player will be betting.
  40.     int        nGameState;        // Where in this hand we are in (deal, bet, draw, bet, showdown)
  41.     
  42.     int        bCanCall;        // We can call the bet. TRUE if a player has bet or raised
  43.     int        bCanBet;        // We are the first player, or after prev players checked.
  44.     int        bCanFold;        // Always, except if we've folded already.
  45.     int        bCanRaise;        // Another player raised or bet. Can't raise our own bet.
  46.     int        bCanCheck;        // Only if previous players (if any) have checked.
  47.  
  48. // Implementation
  49. public:
  50.     virtual ~CPokerDoc();
  51.     virtual void Serialize(CArchive& ar);    // overridden for document i/o
  52.     void    NewGame();
  53.     int     Deal();
  54.     int        DealDraw(int nPlayer);
  55.     int        EvaluateFirst(int nPlayer);
  56.     void    Bet(int    nPlayer, int nChips);
  57.     void    Call(int nPlayer);
  58.     void    Fold(int nPlayer);
  59.     void    Raise(int nPlayer, int nChips);
  60.     void    Check(int nPlayer);
  61.     void    NextPlayer();
  62.     void    UpdateGameState();
  63.     
  64. #ifdef _DEBUG
  65.     virtual    void AssertValid() const;
  66.     virtual    void Dump(CDumpContext& dc) const;
  67. #endif
  68. protected:
  69.     virtual    BOOL    OnNewDocument();
  70.  
  71. // Generated message map functions
  72. protected:
  73.     //{{AFX_MSG(CPokerDoc)
  74.         // NOTE - the ClassWizard will add and remove member functions here.
  75.         //    DO NOT EDIT what you see in these blocks of generated code !
  76.     //}}AFX_MSG
  77.     DECLARE_MESSAGE_MAP()
  78. };
  79.  
  80. /////////////////////////////////////////////////////////////////////////////
  81.