Hooks
static bool BeforeCvTwoLayerPathFinder_Initialize(CvTwoLayerPathFinder* self, int iColumns, int iRows, bool bWrapX, bool bWrapY, CvAPointFunc IsPathDestFunc, CvAPointFunc DestValidFunc, CvAHeuristic HeuristicFunc, CvAStarFunc CostFunc, CvAStarFunc ValidFunc, CvAStarFunc NotifyChildFunc, CvAStarFunc NotifyListFunc, CvABegin InitializeFunc, CvAEnd UninitializeFunc, const void* pData);static void AfterCvTwoLayerPathFinder_Initialize(CvTwoLayerPathFinder* self, int iColumns, int iRows, bool bWrapX, bool bWrapY, CvAPointFunc IsPathDestFunc, CvAPointFunc DestValidFunc, CvAHeuristic HeuristicFunc, CvAStarFunc CostFunc, CvAStarFunc ValidFunc, CvAStarFunc NotifyChildFunc, CvAStarFunc NotifyListFunc, CvABegin InitializeFunc, CvAEnd UninitializeFunc, const void* pData);static void ReplaceCvTwoLayerPathFinder_Initialize(void (*original)(CvTwoLayerPathFinder*, int, int, bool, bool, CvAPointFunc, CvAPointFunc, CvAHeuristic, CvAStarFunc, CvAStarFunc, CvAStarFunc, CvAStarFunc, CvABegin, CvAEnd, const void*), CvTwoLayerPathFinder* self, int iColumns, int iRows, bool bWrapX, bool bWrapY, CvAPointFunc IsPathDestFunc, CvAPointFunc DestValidFunc, CvAHeuristic HeuristicFunc, CvAStarFunc CostFunc, CvAStarFunc ValidFunc, CvAStarFunc NotifyChildFunc, CvAStarFunc NotifyListFunc, CvABegin InitializeFunc, CvAEnd UninitializeFunc, const void* pData);CivRegisterBefore<CivHooks::CvTwoLayerPathFinder_Initialize>(host, &BeforeCvTwoLayerPathFinder_Initialize);CivRegisterAfter<CivHooks::CvTwoLayerPathFinder_Initialize>(host, &AfterCvTwoLayerPathFinder_Initialize);CivRegisterReplace<CivHooks::CvTwoLayerPathFinder_Initialize>(host, &ReplaceCvTwoLayerPathFinder_Initialize);
Code
2799/// Allocate memory, zero variables2800void CvTwoLayerPathFinder::Initialize(int iColumns, int iRows, bool bWrapX, bool bWrapY, CvAPointFunc IsPathDestFunc, CvAPointFunc DestValidFunc, CvAHeuristic HeuristicFunc, CvAStarFunc CostFunc, CvAStarFunc ValidFunc, CvAStarFunc NotifyChildFunc, CvAStarFunc NotifyListFunc, CvABegin InitializeFunc, CvAEnd UninitializeFunc, const void* pData)2801{2802 int iI, iJ;28032804 DeInit();28052806 CvAStar::Initialize(iColumns, iRows, bWrapX, bWrapY, IsPathDestFunc, DestValidFunc, HeuristicFunc, CostFunc, ValidFunc, NotifyChildFunc, NotifyListFunc, NULL, NULL, InitializeFunc, UninitializeFunc, pData);28072808 m_ppaaPartialMoveNodes = FNEW(CvAStarNode*[m_iColumns], c_eCiv5GameplayDLL, 0);2809 for(iI = 0; iI < m_iColumns; iI++)2810 {2811 m_ppaaPartialMoveNodes[iI] = FNEW(CvAStarNode[m_iRows], c_eCiv5GameplayDLL, 0);2812 for(iJ = 0; iJ < m_iRows; iJ++)2813 {2814 m_ppaaPartialMoveNodes[iI][iJ].m_iX = iI;2815 m_ppaaPartialMoveNodes[iI][iJ].m_iY = iJ;2816 }2817 }2818}