Пример #1
0
 private static SquarePoint GetClosetSqare(SquareInformation pInfo, HeightInfo Height, bool bool_0, bool UserOverride, bool HeightOverride)
 {
     double num = pInfo.Point.GetDistance;
     SquarePoint result = pInfo.Point;
     double state = Height.GetState(pInfo.Point.X, pInfo.Point.Y);
     for (int i = 0; i < 8; i++)
     {
         SquarePoint squarePoint = pInfo.Pos(i);
         if (squarePoint.InUse && squarePoint.CanWalk && ((Height.GetState(squarePoint.X, squarePoint.Y) - state) <= 2.0 + Height.GetMapHeight(pInfo.Point.X, pInfo.Point.Y) || UserOverride || HeightOverride))
         {
             double getDistance = squarePoint.GetDistance;
             if (num > getDistance)
             {
                 num = getDistance;
                 result = squarePoint;
             }
         }
     }
     return result;
 }
Пример #2
0
        private static SquarePoint GetClosetSqare(SquareInformation pInfo, HeightInfo Height, bool bool_0, bool UserOverride, bool HeightOverride)
        {
            double      num    = pInfo.Point.GetDistance;
            SquarePoint result = pInfo.Point;
            double      state  = Height.GetState(pInfo.Point.X, pInfo.Point.Y);

            for (int i = 0; i < 8; i++)
            {
                SquarePoint squarePoint = pInfo.Pos(i);
                if (squarePoint.InUse && squarePoint.CanWalk && ((Height.GetState(squarePoint.X, squarePoint.Y) - state) <= 2.0 + Height.GetMapHeight(pInfo.Point.X, pInfo.Point.Y) || UserOverride || HeightOverride))
                {
                    double getDistance = squarePoint.GetDistance;
                    if (num > getDistance)
                    {
                        num    = getDistance;
                        result = squarePoint;
                    }
                }
            }
            return(result);
        }