/** Prepares low level path variables for calculation.
* Called before a path search will take place.
* Always called before the Prepare, Initialize and CalculateStep functions
*/
protected void PrepareBase(PathHandler pathHandler)
{
//Path IDs have overflowed 65K, cleanup is needed
//Since pathIDs are handed out sequentially, we can do this
if (pathHandler.PathID > pathID)
{
pathHandler.ClearPathIDs();
}
//Make sure the path has a reference to the pathHandler
this.pathHandler = pathHandler;
//Assign relevant path data to the pathHandler
pathHandler.InitializeForPath(this);
// Make sure that internalTagPenalties is an array which has the length 32
if (internalTagPenalties == null || internalTagPenalties.Length != 32)
{
internalTagPenalties = ZeroTagPenalties;
}
try {
ErrorCheck();
} catch (System.Exception e) {
ForceLogError("Exception in path " + pathID + "\n" + e);
}
}