ChessWnd.h
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:2k
- #if !defined(AFX_CHESSWND_H__793A9FA0_7BF7_11D3_BA84_0000E8A021D8__INCLUDED_)
- #define AFX_CHESSWND_H__793A9FA0_7BF7_11D3_BA84_0000E8A021D8__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif
- class CChessWnd : public CWnd
- {
- enum {GS_GameNotStart,GS_GameStart,GS_IsOurTurn,GS_ChessSelected};
- typedef struct _Position
- {
- BYTE x;
- BYTE y;
- }MOUSEPOSITION,*LPMOUSEPOSITION;
- typedef struct _MOVEMSG
- {
- BYTE byType;
- BYTE byOriginalXpos;
- BYTE byOriginalYpos;
- BYTE byFinalXpos;
- BYTE byFinalYpos;
- }MOVEMSG, *LPMOVEMSG;
- #define NoChess 0
- #define FrameXpos 17
- #define FrameYpos 15
- #define ChessSize 40
- public:
- CChessWnd();
- public:
- public:
- public:
- int gnGameState;
- RECT gChessFieldRect;
- BYTE gField[10][9];
- BOOL bCheck;
- BOOL gbFirst;
- BOOL bMoveTurnOn;
- BOOL gbIsRed;
- MOVEMSG gMoveMsg;
- LPMOVEMSG lpMoveMsg;
- LPMOUSEPOSITION gLpOriginalCrossNum;
- LPMOUSEPOSITION gLpFinalCrossNum;
- BOOL GetMouseLocation(CPoint Pos,LPMOUSEPOSITION LpChessCrossNum);
- BOOL CheckMoving();
- void DoMoving();
- void InitOurField();
- void PrepareChess();
- virtual ~CChessWnd();
- protected:
- //{{AFX_MSG(CChessWnd)
- afx_msg void OnPaint();
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnDestroy();
- //}}AFX_MSG
- HBITMAP m_Background;
- DECLARE_MESSAGE_MAP()
- };
- #endif