Pathfinding.Path.PrepareBase C# (CSharp) Method

PrepareBase() public method

public PrepareBase ( PathHandler pathHandler ) : void
pathHandler PathHandler
return void
		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);
			}
		}

Usage Example

 static int PrepareBase(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Pathfinding.Path        obj  = (Pathfinding.Path)ToLua.CheckObject <Pathfinding.Path>(L, 1);
         Pathfinding.PathHandler arg0 = (Pathfinding.PathHandler)ToLua.CheckObject <Pathfinding.PathHandler>(L, 2);
         obj.PrepareBase(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
All Usage Examples Of Pathfinding.Path::PrepareBase