本文整理汇总了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());
}
}