home *** CD-ROM | disk | FTP | other *** search
/ Troubleshooting Netware Systems / CSTRIAL0196.BIN / attach / msj / v10n08 / mfcpart3.exe / TICTAC.H < prev   
C/C++ Source or Header  |  1995-08-01  |  875b  |  39 lines

  1. class CMyApp : public CWinApp
  2. {
  3. public:
  4.     BOOL InitInstance ();
  5. };
  6.  
  7. class CMainWindow : public CWnd
  8. {
  9. private:
  10.     CRect m_rect[9];                // Rectangles denoting grid squares
  11.     int m_nNextChar;                // Next character (EX for X or OH for O)
  12.     int m_nGameGrid[9];             // The game grid (0=empty square)
  13.  
  14.     int GetRectID (CPoint);
  15.     void DrawBoard (CDC*);
  16.     void DrawX (CDC*, int);
  17.     void DrawO (CDC*, int);
  18.     void ResetGame ();
  19.     void CheckForGameOver ();
  20.     int IsWinner ();
  21.     BOOL IsDraw ();
  22.  
  23. public:
  24.     CMainWindow ();
  25.  
  26. protected:
  27.     void PostNcDestroy ();
  28.  
  29.     afx_msg void OnPaint ();
  30.     afx_msg void OnLButtonDown (UINT, CPoint);
  31.     afx_msg void OnLButtonDblClk (UINT, CPoint);
  32.     afx_msg void OnRButtonDown (UINT, CPoint);
  33.  
  34.     DECLARE_MESSAGE_MAP ()
  35. };
  36.  
  37. #define EX 1
  38. #define OH 2
  39.