Ejemplo n.º 1
0
 public virtual float DistanceTo(Pathfinding.IPoint pPoint)
 {
     if (pPoint is SampleNode)
     {
         SampleNode otherNode = pPoint as SampleNode;
         return(_localPoint.EuclidianDistanceTo(otherNode._localPoint));
     }
     else
     {
         throw new NotImplementedException();
     }
 }
Ejemplo n.º 2
0
        public int CompareTo(object obj)
        {
            SampleNode target      = obj as SampleNode;
            float      targetValue = target.pathCostHere + target.distanceToGoal;
            float      thisValue   = pathCostHere + distanceToGoal;

            if (targetValue > thisValue)
            {
                return(1);
            }
            else if (targetValue == thisValue)
            {
                return(0);
            }
            else
            {
                return(-1);
            }
        }