game.h
来自「设计一类peg jump问题的求解系统」· C头文件 代码 · 共 67 行
H
67 行
// game.h: interface for the game class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_GAME_H__7B0198E8_EBE4_4E15_840F_61F5B58557B1__INCLUDED_)
#define AFX_GAME_H__7B0198E8_EBE4_4E15_840F_61F5B58557B1__INCLUDED_
#include <time.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define DFS 1
#define BFS 0
typedef struct Node
{
int m_data[7][7];
int m_num;
struct Node *m_parent;
} node;
class game
{
public:
void OnAutoplay(HWND hView);
void setBoard(Node*, int);
game();
virtual ~game();
void DrawBoard(HDC hdc, RECT client);
void PegSolution();
void Init(int style);
public:
UINT m_nodeNum;
void ResetBoardType(int);
int m_boardType;
void despath();
void movepeg(node*pf,int x, int y, int dir);
bool m_solutionFlag;
UINT m_iStepCount;
bool m_bAutoRun;
HWND m_hClientWin;
clock_t m_iTime;
UINT m_searchType;
Node *m_board;
deque<node*> m_opened;
queue<node*> m_closed;
list<node*> m_solution;
};
#endif // !defined(AFX_GAME_H__7B0198E8_EBE4_4E15_840F_61F5B58557B1__INCLUDED_)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?