?? 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 + -