Exemplo n.º 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;
            }
        }
Exemplo n.º 2
0
        public void updatePath(Point3d point)
        {
            GridSquare currentSquare = grid.getGridSquareContainingPoint(point);

            if (currentSquare != null)
            {
                currentPath.AddLast(currentSquare);
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
            }
        }