?? astar.h
字號(hào):
// AStar.h: interface for the CAStar class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ASTAR_H__FED2D936_0161_4933_843F_0A0D71660839__INCLUDED_)
#define AFX_ASTAR_H__FED2D936_0161_4933_843F_0A0D71660839__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "WayPoint.h"
#include <vector>
struct SASNode
{
int x;
int y;
bool bIsOpen;
bool bIsClose;
int ParentIndex;
int H;//預(yù)計(jì)到目標(biāo)點(diǎn)的距離
int G;//沿路徑從起始點(diǎn)到當(dāng)前點(diǎn)的移動(dòng)耗費(fèi)
int F;//G+H
int NeighborCount;
int Neighbor[10];//最多可以有10個(gè)鄰居
int NeighborDistance[10];//到每個(gè)鄰居的距離
};
class CAStar
{
public:
CAStar();
bool FindPath(int FromIndex,int ToIndex);
int GetNodeIndex(int pathIndex);
int GetNodeCount();
void InitNodeByWayPoint(CWayPoint *pWayPoint);
virtual ~CAStar();
private:
SASNode *pASNode;
int PathPointCount;//找到的路徑上的路點(diǎn)數(shù)
int NodeCount;
std::vector<int>OpenList;
std::vector<int>PathList;
};
#endif // !defined(AFX_ASTAR_H__FED2D936_0161_4933_843F_0A0D71660839__INCLUDED_)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -