예제 #1
0
        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;
            }
        }
예제 #2
0
        public void updatePath(Point3d point)
        {
            GridSquare currentSquare = grid.getGridSquareContainingPoint(point);

            if (currentSquare != null)
            {
                currentPath.AddLast(currentSquare);
            }
        }
예제 #3
0
        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;
        }
예제 #4
0
        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;
        }
예제 #5
0
        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;
            }
        }