⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 path.cpp

📁 网络游戏魔域源代码 测试可以完整变异
💻 CPP
字号:
// Path.cpp: implementation of the CPath class.
//
//////////////////////////////////////////////////////////////////////

#include "Path.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CPath::CPath()
{
	m_setStep.clear();
	m_nSearchMethod = _ASTAR_CLOSE;
	m_nData = 15;
}

CPath::~CPath()
{
	m_setStep.clear();
}

//--------------------------------------------------------------------
int CPath::TestNextStep()
{
	if(m_setStep.size() <= 0)
		return -1;
	return m_setStep[0].cStepDir % 8;
}
//--------------------------------------------------------------------
BOOL  CPath::GetNextStep(StepInfo& infoStep)
{
	if(m_setStep.size() <= 0)
		return false;
	infoStep =  (StepInfo)m_setStep[0];
	m_setStep.pop_front();
	return true;
}
//--------------------------------------------------------------------
void CPath::ClearStep()
{
	m_setStep.clear();
}
//--------------------------------------------------------------------
void CPath::AddStep(char cStep, unsigned char ucStepLength)
{
	StepInfo infoStep = {cStep, ucStepLength};
	m_setStep.push_back(infoStep);
}
//--------------------------------------------------------------------
int  CPath::GetStepAmount()
{
	return m_setStep.size();
}
//--------------------------------------------------------------------
void CPath::SetPlayer(CMapObj* pMapObj)
{
	m_pMapObj = pMapObj; 
}
//--------------------------------------------------------------------
void CPath::SetSearchMethod(int nMethod)
{
	m_nSearchMethod = nMethod;
}
//--------------------------------------------------------------------
int  CPath::GetSearchMethod()
{
	return m_nSearchMethod;
}
//--------------------------------------------------------------------
void CPath::SetPathData(int nData)
{
	m_nData = nData;
}
//--------------------------------------------------------------------
int	CPath::GetData()
{
	return m_nData;
}
//--------------------------------------------------------------------

⌨️ 快捷键说明

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