📄 maze.~h
字号:
//---------------------------------------------------------------------------
#ifndef MazeH
#define MazeH
#include <vcl.h>
#include <vector>
#include <algorithm>
using namespace std;
//---------------------------------------------------------------------------
class Node
{
public:
Node():x(1),y(0),cost(0),g(0),pre(NULL),dir(0){};
bool operator<(const Node & m)const;
int x;
int y;
Node * pre;//父结点
int cost;//代价
int h;//启发式函数
int g;
int dir;//方向0,1,2,3
Node * adr;//本结点地址
};
class Maze
{
public:
Maze();
~Maze();
void CreateMaze(int &x,int &y,TForm * f);
void MakeMaze(int &x,int &y,float &bili);
void DeleteShp(int &x,int &y);
void SearchRoad(int &x,int &y,int gd,int sd,int ax);
void Destroy();
vector <Node> open;//Open表
vector <Node> closed;//Closed表
private:
int num;//方向数
int ShpWidth;//shape的宽度
int ShpHeight;//shape的长度
int HEIGHT_MAX;//迷宫方块最大高度
int WIDTH_MAX;//迷宫方块最大宽度
int ** Maze; //2维数组
bool ReDraw;
TShape *Shp[50][50];
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -