コード例 #1
0
 public SquarePoint(int pX, int pY, int pTargetX, int pTargetY, byte SquareData, bool pOverride)
 {
     this.mX          = pX;
     this.mY          = pY;
     this.mSquareData = SquareData;
     this.mInUse      = true;
     this.mOverride   = pOverride;
     this.mDistance   = 0.0;
     this.mLastStep   = (pX == pTargetX && pY == pTargetY);
     this.mDistance   = DreamPathfinder.GetDistance(pX, pY, pTargetX, pTargetY);
 }
コード例 #2
0
        internal static SquarePoint GetNextStep(int pUserX, int pUserY, int pUserTargetX, int pUserTargetY, byte[,] pGameMap, double[,] pHeight, double[,] double_1, double[,] double_2, int MaxX, int MaxY, bool pUserOverride, bool pDiagonal, bool[,] iHeightOverride)
        {
            ModelInfo   pMap        = new ModelInfo(MaxX, MaxY, pGameMap);
            SquarePoint squarePoint = new SquarePoint(pUserTargetX, pUserTargetY, pUserTargetX, pUserTargetY, pMap.GetState(pUserTargetX, pUserTargetY), pUserOverride);
            SquarePoint result;

            if (pUserX == pUserTargetX && pUserY == pUserTargetY)
            {
                result = squarePoint;
            }
            else
            {
                SquareInformation pInfo = new SquareInformation(pUserX, pUserY, squarePoint, pMap, pUserOverride, pDiagonal);
                result = DreamPathfinder.GetClosetSqare(pInfo, new HeightInfo(MaxX, MaxY, pHeight, double_1, double_2), pDiagonal, pUserOverride, iHeightOverride);
            }
            return(result);
        }