示例#1
0
 public Pathfinder(IMyCubeGrid grid)
 {
     grid.throwIfNull_argument("grid");
     CubeGrid      = grid;
     myPathChecker = new PathChecker(grid);
     myLogger      = new Logger("Pathfinder", () => grid.DisplayName);
     myOutput      = new PathfinderOutput(myPathChecker, PathfinderOutput.Result.Incomplete);
 }
示例#2
0
 private void SetOutput(PathfinderOutput newOutput)
 {
     if (myPathChecker != null && myPathChecker.Interrupt)
     {
         return;
     }
     using (lock_myOutput.AcquireExclusiveUsing())
         myOutput = newOutput;
 }
示例#3
0
 public PathfinderOutput GetOutput()
 {
     using (lock_myOutput.AcquireSharedUsing())
     {
         PathfinderOutput temp = myOutput;
         if (temp.PathfinderResult != PathfinderOutput.Result.Incomplete)
         {
             myOutput = new PathfinderOutput(myPathChecker, PathfinderOutput.Result.Incomplete);
         }
         return(temp);
     }
 }