예제 #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);
     }
 }