📄 cell.cpp
字号:
// Cell.cpp: implementation of the CCell class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "test.h"
#include "Cell.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCell::CCell()
{
px=py=0;
f=g=h=0;
pParent=NULL;
}
CCell::CCell(int x,int y)
{
px=x;
py=y;
pParent=NULL;
}
CCell::~CCell()
{
}
void CCell::ComputeGHF()
{
/*int x,y;
x=abs(px-pParent->px);
y=abs(py-pParent->py);*/
int xa,ya;//npow;
xa=abs(px-pParent->px)*10;
ya=abs(py-pParent->py)*10;
if (xa==10 && ya==10)
g=14+pParent->g;
else
g=10+pParent->g;
f=g+h;
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -