ChessWnd.h
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:2k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. #if !defined(AFX_CHESSWND_H__793A9FA0_7BF7_11D3_BA84_0000E8A021D8__INCLUDED_)
  2. #define AFX_CHESSWND_H__793A9FA0_7BF7_11D3_BA84_0000E8A021D8__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif
  6. class CChessWnd : public CWnd
  7. {
  8. enum {GS_GameNotStart,GS_GameStart,GS_IsOurTurn,GS_ChessSelected};
  9. typedef struct _Position
  10. {
  11. BYTE x;
  12. BYTE y;
  13. }MOUSEPOSITION,*LPMOUSEPOSITION;
  14. typedef struct _MOVEMSG
  15. {
  16. BYTE        byType;
  17. BYTE byOriginalXpos;
  18. BYTE byOriginalYpos;
  19. BYTE byFinalXpos;
  20. BYTE byFinalYpos;
  21. }MOVEMSG, *LPMOVEMSG;
  22. #define NoChess 0
  23. #define FrameXpos  17
  24. #define FrameYpos  15
  25. #define ChessSize            40
  26. public:
  27. CChessWnd();
  28. public:
  29. public:
  30. public:
  31. int gnGameState;
  32. RECT gChessFieldRect;
  33. BYTE gField[10][9];
  34. BOOL bCheck;
  35. BOOL gbFirst;
  36. BOOL bMoveTurnOn;
  37. BOOL gbIsRed;
  38. MOVEMSG gMoveMsg;
  39. LPMOVEMSG lpMoveMsg;
  40. LPMOUSEPOSITION gLpOriginalCrossNum;
  41. LPMOUSEPOSITION gLpFinalCrossNum;
  42. BOOL GetMouseLocation(CPoint Pos,LPMOUSEPOSITION LpChessCrossNum);
  43. BOOL CheckMoving();
  44. void DoMoving();
  45. void InitOurField();
  46. void PrepareChess();
  47. virtual ~CChessWnd();
  48. protected:
  49. //{{AFX_MSG(CChessWnd)
  50. afx_msg void OnPaint();
  51. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  52. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  53. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  54. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  55. afx_msg void OnDestroy();
  56. //}}AFX_MSG
  57. HBITMAP m_Background;
  58. DECLARE_MESSAGE_MAP()
  59. };
  60. #endif