robotgrid.h

来自「该程序实现两个机器人在一个二维网格中的自动追捕。通过方向键手动控制机器人A走步」· C头文件 代码 · 共 65 行

H
65
字号
#if !defined(AFX_ROBOTGRID_H__3F2BC70D_0231_44C9_8668_60571AE6B829__INCLUDED_)
#define AFX_ROBOTGRID_H__3F2BC70D_0231_44C9_8668_60571AE6B829__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// RobotGrid.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CRobotGrid window
#include "CommonData.h"

class CRobotGrid : public CStatic
{
// Construction
public:
	CRobotGrid();
	void  WhiteAutoCatch();
	void  BlackAutoEscape();
	void  EraseRobot(int RobotType);
private:
	void  DrawGrid(CDC *pdc);
	void  DrawRobot(int RobotType, CDC *pdc);
	
	void  WhiteCreateTree(SEARCHITEM *& pRoot);
	void  BlackCreateTree(SEARCHITEM *& pRoot);
	void  WhiteNextStep(SEARCHITEM *pRoot);
	void  BlackNextStep(SEARCHITEM *pRoot);
	void  ReleaseMem(SEARCHITEM *pRoot);
	BOOL  CheckIfSamePos(ROBOTITEM item1, ROBOTITEM item2);
// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRobotGrid)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CRobotGrid();

	// Generated message map functions
protected:
	//{{AFX_MSG(CRobotGrid)
	afx_msg void OnPaint();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ROBOTGRID_H__3F2BC70D_0231_44C9_8668_60571AE6B829__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?