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, int[,] GroupGates, Room room, double Height) { ModelInfo pMap = new ModelInfo(MaxX, MaxY, pGameMap); List <RoomItem> ItemsOnSquare = room.method_93(pUserTargetX, pUserTargetY); SquarePoint squarePoint = new SquarePoint(pUserTargetX, pUserTargetY, pUserTargetX, pUserTargetY, pMap.GetState(pUserTargetX, pUserTargetY), pUserOverride, GroupGates[pUserTargetX, pUserTargetY] > 0, ItemsOnSquare, Height, room.GetRoomUsersBySquare(pUserTargetX, pUserTargetY), room); SquarePoint result; if (pUserX == pUserTargetX && pUserY == pUserTargetY) { result = squarePoint; } else { try { SquareInformation pInfo = new SquareInformation(pUserX, pUserY, squarePoint, pMap, pUserOverride, pDiagonal, GroupGates, room, Height); result = DreamPathfinder.GetClosetSqare(pInfo, new HeightInfo(MaxX, MaxY, pHeight, double_1, double_2), pDiagonal, pUserOverride, iHeightOverride, GroupGates); } catch { return(squarePoint); } } return(result); }
public SquarePoint(int pX, int pY, int pTargetX, int pTargetY, byte SquareData, bool pOverride, bool pIsGroupGate, List <RoomItem> itemsOnSq, double Height, List <RoomUser> usersonSq, Room room) { this.mX = pX; this.mY = pY; this.mIsGroupGate = pIsGroupGate; 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); this.mHeight = Height; List <WalkUnderElement> walkunderele = new List <WalkUnderElement>(); this.itemsonSquare = itemsOnSq.OrderBy(o => o.Double_0).ToList(); foreach (RoomItem ri in itemsOnSq) { walkunderele.Add(new WalkUnderElement(ri.Double_0, ri.Double_1, ri.GetBaseItem().Walkable, ri.uint_0, ri)); } this.currentRoom = room; if (walkunderele.Where(o => o.Height == 0).ToList().Count == 0) { walkunderele.Add(new WalkUnderElement(0, 0, true, 0, null)); } this.walkunderElements = walkunderele.OrderBy(o => o.Height).ToList(); }