-
Notifications
You must be signed in to change notification settings - Fork 0
/
CGAME.h
59 lines (50 loc) · 1.23 KB
/
CGAME.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#include "CGAME_Display.h"
#include "CGAME_Map.h"
#include "CRESOURCE.h"
/*
#define DIR_UP 0
#define DIR_DOWN 1
#define DIR_LEFT 2
#define DIR_RIGHT 3
#define DIR_FIRST 0
#define DIR_LAST 3
const int dx[4] = { -1, 1, 0, 0 };
const int dy[4] = { 0, 0, -1, 1 };
*/
// CGAME 对话框
class CGAME : public CDialogEx
{
DECLARE_DYNAMIC(CGAME)
public:
CGAME(CRESOURCE* currentRes, CWnd* pParent = nullptr); // 标准构造函数
virtual ~CGAME();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_GAME };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
virtual BOOL PreTranslateMessage(MSG* pMsg);
DECLARE_MESSAGE_MAP()
public:
virtual void OnTimer(UINT_PTR nIdEvent);
virtual BOOL OnInitDialog();
virtual BOOL DestroyWindow();
afx_msg void OnBnClickedGameRestartbutton();
afx_msg void OnBnClickedGameReturnbutton();
afx_msg LRESULT StartGame(WPARAM wParam, LPARAM lParam);
protected:
/*初始化计步器和计时器*/
virtual void InitStepAndTimer();
/*步数加一并更新步数显示*/
virtual void IncrementStep(BOOL moved);
private:
CFont m_font;
int m_step,m_mm,m_ss;
UINT_PTR m_Timer;
CGAME_Display* myDisplay;
CGAME_Map* myMap;
CRESOURCE* myRes;
public:
};