public void updatePath(Point3d point) { GridSquare currentSquare = grid.getGridSquareContainingPoint(point); if (currentSquare != null) { currentPath.AddLast(currentSquare); } // Advance to the next target if (currentSquare == currentTarget) { currentTarget = manipulatableTargetSequence.Dequeue(); } double currentDistance = euclideanDistance(new Point2d(point.X, point.Y), currentTarget.getCenter()); if (currentDistance > previousDistance) { failedAuthentication = true; } else { previousDistance = currentDistance; } }
public void updatePath(Point3d point) { GridSquare currentSquare = grid.getGridSquareContainingPoint(point); if (currentSquare != null) { currentPath.AddLast(currentSquare); } }
public CheckPointPath(Queue<GridSquare> targetSquares, Grid grid) : base(grid) { this.originalTargetSequence = targetSquares; this.completedTargets = new HashSet<GridSquare>(); this.manipulatableTargetSequence = new Queue<GridSquare>(); for (int i = 0; i < originalTargetSequence.Count; i++) { GridSquare square = originalTargetSequence.Dequeue(); originalTargetSequence.Enqueue(square); manipulatableTargetSequence.Enqueue(square); } currentTarget = manipulatableTargetSequence.Dequeue(); this.previousDistance = Double.MaxValue; this.failedAuthentication = false; }
public CheckPointPath(Queue <GridSquare> targetSquares, Grid grid) : base(grid) { this.originalTargetSequence = targetSquares; this.completedTargets = new HashSet <GridSquare>(); this.manipulatableTargetSequence = new Queue <GridSquare>(); for (int i = 0; i < originalTargetSequence.Count; i++) { GridSquare square = originalTargetSequence.Dequeue(); originalTargetSequence.Enqueue(square); manipulatableTargetSequence.Enqueue(square); } currentTarget = manipulatableTargetSequence.Dequeue(); this.previousDistance = Double.MaxValue; this.failedAuthentication = false; }