Bazaar developer reference

CvAStar::GetBest()

Defined in
CvAStar.cpp, line 341
Class
CvAStar
Hook name
CivHooks::CvAStar_GetBest

Hooks

static bool BeforeCvAStar_GetBest(CvAStar* self, CvAStarNode*& result);static void AfterCvAStar_GetBest(CvAStar* self, CvAStarNode*& result);static CvAStarNode* ReplaceCvAStar_GetBest(CvAStarNode* (*original)(CvAStar*), CvAStar* self);CivRegisterBefore<CivHooks::CvAStar_GetBest>(host, &BeforeCvAStar_GetBest);CivRegisterAfter<CivHooks::CvAStar_GetBest>(host, &AfterCvAStar_GetBest);CivRegisterReplace<CivHooks::CvAStar_GetBest>(host, &ReplaceCvAStar_GetBest);

Code

340/// Returns best node341CvAStarNode* CvAStar::GetBest()342{343	CvAStarNode* temp;344345	if(!m_pOpen)346	{347		return NULL;348	}349350	temp = m_pOpen;351352	m_pOpen = temp->m_pNext;353	if(m_pOpen != NULL)354	{355		m_pOpen->m_pPrev = NULL;356	}357	else358	{359		m_pOpenTail = NULL;360	}361362	udFunc(udNotifyList, NULL, temp, ASNL_DELETEOPEN, m_pData);363364	temp->m_eCvAStarListType = CVASTARLIST_CLOSED;365366	temp->m_pNext = m_pClosed;367	if(m_pClosed != NULL)368	{369		m_pClosed->m_pPrev = temp;370	}371	m_pClosed = temp;372373	udFunc(udNotifyList, NULL, m_pClosed, ASNL_ADDCLOSED, m_pData);374375	return temp;376}

Calls

Called by