📄 arrestdlg.h
字号:
// ArrestDlg.h : header file
//
#if !defined(AFX_ARRESTDLG_H__2DFA1050_D56F_4A1C_83CF_FBFEECBF0698__INCLUDED_)
#define AFX_ARRESTDLG_H__2DFA1050_D56F_4A1C_83CF_FBFEECBF0698__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//////////////////////////////////////////////////////////////////////////
#include <deque>
#include "ARSUtility.h"
#include "ARSField.h"
using namespace std;
#define FIELD_SIZE_SMALL 15 //场地大小初始值
#define iEDGE1 20 //场地边界大小(20,20,450,450)
#define iEDGE2 450
#define MAX_NUM_PERSON 7 //场地总人数,包括一个贼
//////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// CArrestDlg dialog
class CArrestDlg : public CDialog
{
// Construction
public:
CArrestDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CArrestDlg)
enum { IDD = IDD_ARREST_DIALOG };
CButton m_butStart;
CComboBox m_comPolice6;
CComboBox m_comPolice5;
CComboBox m_comPolice4;
CComboBox m_comPolice1;
CComboBox m_comPolice3;
CComboBox m_comPolice2;
CComboBox m_comThief;
CComboBox m_comboFieldSize;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CArrestDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CArrestDlg)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
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 OnSelendokCombofieldsize();
afx_msg void OnButtonreset();
afx_msg void OnButtonstart();
afx_msg void OnSelendokCombopolice1();
afx_msg void OnSelendokCombopolice2();
afx_msg void OnSelendokCombopolice3();
afx_msg void OnSelendokCombopolice4();
afx_msg void OnSelendokCombopolice5();
afx_msg void OnSelendokCombopolice6();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
//画场地
void DrawField(int iSize);
//由场地坐标转换为屏幕单元格
CRect XYToRect(int x,int y);
//画贼
void DrawRound(int x,int y,bool isErased);
//画警察
void DrawRect(int x,int y,bool isErased);
//由屏幕坐标画求出场地坐标
bool PointToXY(const CPoint &ptMouse,long &x,long &y);
//画出所有人的位置
void DrawPerson(bool bErase);
//判定鼠标是否选中人
bool ChoicePerson(const int&x,const int &y,int &choicePerson);
//初始化所有人的位置
void InitPersonPosition();
//显示当前步数
void ShowStepsStat();
void EnableComboxes(bool bEnable);
void ReadStrategy();
public:
int m_iFieldSize; //场地大小
bool m_bMouseDown; //鼠标是否按下
CPoint m_ptPerson[MAX_NUM_PERSON]; //所有人的场地坐标
int m_iPersonStrategy[MAX_NUM_PERSON];//所有人的策略
bool m_bStartPhase; //开始阶段标志
CPoint m_tmpPoint; //临时点记录
int m_iPersonNum; //当前人编号
int m_iStepsStat; //移动步数统计
deque <int> m_dqThiefStrategy;
deque<int> m_dqPoliceStrategy;
MOVEDIRECTION m_ThiefMenuDir;
ARSField m_arsField;
bool m_bKeyControl;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ARRESTDLG_H__2DFA1050_D56F_4A1C_83CF_FBFEECBF0698__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -