本文整理匯總了C#中Pathfinding.PathHandler.InitializeForPath方法的典型用法代碼示例。如果您正苦於以下問題:C# PathHandler.InitializeForPath方法的具體用法?C# PathHandler.InitializeForPath怎麽用?C# PathHandler.InitializeForPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pathfinding.PathHandler
的用法示例。
在下文中一共展示了PathHandler.InitializeForPath方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PrepareBase
public void PrepareBase(PathHandler pathHandler)
{
if (pathHandler.PathID > this.pathID)
{
pathHandler.ClearPathIDs();
}
this.pathHandler = pathHandler;
pathHandler.InitializeForPath(this);
if (this.internalTagPenalties == null || this.internalTagPenalties.Length != 32)
{
this.internalTagPenalties = Path.ZeroTagPenalties;
}
try
{
this.ErrorCheck();
}
catch (Exception ex)
{
this.ForceLogError(string.Concat(new object[]
{
"Exception in path ",
this.pathID,
"\n",
ex
}));
}
}
示例2: PrepareBase
/** Prepares low level path variables for calculation.
* Called before a path search will take place.
* Always called before the Prepare, Initialize and CalculateStep functions
*/
public 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);
}
}
示例3: PrepareBase
/** Prepares low level path variables for calculation.
* Called before a path search will take place.
* Always called before the Prepare, Initialize and CalculateStep functions
*/
public 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);
try {
ErrorCheck ();
} catch (System.Exception e) {
ForceLogError ("Exception in path "+pathID+"\n"+e.ToString());
}
}