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); }
private void SetOutput(PathfinderOutput newOutput) { if (myPathChecker != null && myPathChecker.Interrupt) { return; } using (lock_myOutput.AcquireExclusiveUsing()) myOutput = newOutput; }
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); } }