clspoint.~h

来自「最小生成树的算法范例」· ~H 代码 · 共 41 行

~H
41
字号
/*
;=============================================================================
; 名称:clsPOINT
;=============================================================================
; 描述:节点,用来存放入开启或者关闭列表
;=============================================================================
*/
class clsPOINT{
public:
	clsPOINT(int tx, int ty, int tfather_d = 5, int tg = 0, int th = 0):
	         x(tx), y(ty), father_d(tfather_d), g(tg), h(tg){}
	int x;
	int y;
	int father_d;
	int g;
	int h;
	int f(){return g + h;}
};

/*
;=============================================================================
; 名称:clsNODE
;=============================================================================
; 描述:节点,用来存放入开启或者关闭列表
;=============================================================================
*/
class clsNODE{
public:
	int x;
	int y;
	int father_d;     //父节点的方向
	int g;
	int h;
	int f;
	int Flag;         //节点标志 0 通行,未检查过
	                  //         1 不通行
	                  //         2 开启,通行
	                  //         3 关闭,通行
	                  //        -1 路径,通行
	int openlist_id;  //保存自己在开启列表中的索引,每个节点都唯一
};

⌨️ 快捷键说明

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