Pathfinding.PathHandler.InitializeForPath C# (CSharp) Method

InitializeForPath() public method

public InitializeForPath ( Path p ) : void
p Path
return void
		public void InitializeForPath (Path p) {
			pathID = p.pathID;
			heap.Clear();
		}

Usage Example

コード例 #1
0
ファイル: Path.cs プロジェクト: yellowshq/myGameFramework
        /** 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);
            }
        }
All Usage Examples Of Pathfinding.PathHandler::InitializeForPath