コード例 #1
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, 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;
 }
コード例 #2
0
        public SquareInformation(int pX, int pY, SquarePoint pTarget, ModelInfo pMap, bool pUserOverride, bool CalculateDiagonal, int[,] GroupGates, Room room, double Height)
        {
            this.mX = pX;
            this.mY = pY;
            this.mTarget = pTarget;

            this.mPoint = new SquarePoint(pX, pY, pTarget.X, pTarget.Y, pMap.GetState(pX, pY), pUserOverride, false, room.method_93(pX, pY), Height, room.GetRoomUsersBySquare(pX, pY),room);
            this.mPos = new SquarePoint[8];
            if (CalculateDiagonal)
            {
                this.mPos[1] = new SquarePoint(pX - 1, pY - 1, pTarget.X, pTarget.Y, pMap.GetState(pX - 1, pY - 1), pUserOverride, false, room.method_93(pX - 1, pY - 1), Height, room.GetRoomUsersBySquare(pX - 1, pY - 1),room);
                this.mPos[3] = new SquarePoint(pX - 1, pY + 1, pTarget.X, pTarget.Y, pMap.GetState(pX - 1, pY + 1), pUserOverride, false, room.method_93(pX - 1, pY + 1), Height, room.GetRoomUsersBySquare(pX - 1, pY + 1),room);
                this.mPos[5] = new SquarePoint(pX + 1, pY + 1, pTarget.X, pTarget.Y, pMap.GetState(pX + 1, pY + 1), pUserOverride, false, room.method_93(pX + 1, pY + 1), Height, room.GetRoomUsersBySquare(pX + 1, pY + 1),room);
                this.mPos[7] = new SquarePoint(pX + 1, pY - 1, pTarget.X, pTarget.Y, pMap.GetState(pX + 1, pY - 1), pUserOverride, false, room.method_93(pX + 1, pY - 1), Height, room.GetRoomUsersBySquare(pX + 1, pY - 1),room);
            }
            this.mPos[0] = new SquarePoint(pX, pY - 1, pTarget.X, pTarget.Y, pMap.GetState(pX, pY - 1), pUserOverride, false, room.method_93(pX, pY - 1), Height, room.GetRoomUsersBySquare(pX, pY - 1),room);
            this.mPos[2] = new SquarePoint(pX - 1, pY, pTarget.X, pTarget.Y, pMap.GetState(pX - 1, pY), pUserOverride, false, room.method_93(pX - 1, pY), Height, room.GetRoomUsersBySquare(pX - 1, pY),room);
            this.mPos[4] = new SquarePoint(pX, pY + 1, pTarget.X, pTarget.Y, pMap.GetState(pX, pY + 1), pUserOverride, false, room.method_93(pX, pY + 1), Height, room.GetRoomUsersBySquare(pX, pY + 1),room);
            this.mPos[6] = new SquarePoint(pX + 1, pY, pTarget.X, pTarget.Y, pMap.GetState(pX + 1, pY), pUserOverride, false, room.method_93(pX + 1, pY), Height, room.GetRoomUsersBySquare(pX + 1, pY),room);
        }
コード例 #3
0
ファイル: RoomModel.cs プロジェクト: RootkitR/Essential-5.1
        public ServerMessage RelativeHeightmap(Room Room)
        {
            try
            {
                StringBuilder thatMessage = new StringBuilder();
                ServerMessage Message = new ServerMessage(Outgoing.FloorHeightMap); // P
                string[] array = this.string_1.Split(new char[]
			{
				Convert.ToChar(13)
			});
                for (int i = 0; i < this.int_5; i++)
                {
                    if (i > 0)
                    {
                        array[i] = array[i].Substring(1);
                    }
                    for (int j = 0; j < this.int_4; j++)
                    {
                        string text = array[i].Substring(j, 1).Trim().ToLower();
                        if (this.DoorX == j && this.DoorY == i)
                        {
                            text = string.Concat((int)this.double_0);
                        }
                        else if (Room.method_93(j, i).Count > 0)
                         {
                             int Korkeus = 0;
                             List<RoomItem> list = Room.method_93(j, i);

                             foreach (RoomItem @class in Room.Hashtable_0.Values)
                             {
                                 if (@class.GetX == j && @class.Int32_1 == i)
                                 {
                                     if ([email protected]().Stackable)
                                     {
                                         text = "X";
                                         continue;
                                     }
                                     Korkeus = Korkeus + Convert.ToInt32(@class.Double_1);
                                  
                                 }
                                 Dictionary<int, AffectedTile> dictionary = Room.method_94(@class.GetBaseItem().Length, @class.GetBaseItem().Width, @class.GetX, @class.Int32_1, @class.int_3);
                                 foreach (AffectedTile current in dictionary.Values)
                                 {
                                     if (current.Int32_0 == j && current.Int32_1 == i)
                                     {
                                         if ([email protected]().Stackable)
                                         {
                                             text = "X";
                                             continue;
                                         }
                                         Korkeus = Korkeus + Convert.ToInt32(@class.Double_1);
                                     }
                                 }
                                 text = Korkeus.ToString();
                             }

                               
                           
                             
                         }
                        
                        thatMessage.Append(text);
                    }
                    thatMessage.Append(string.Concat(Convert.ToChar(13)));
                }
                Message.AppendString(thatMessage.ToString());
               /* using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\filut\testit.txt", true))
                {
                    file.WriteLine(Message.ToString());
                }*/
                return Message;
            }
            catch (Exception ex)
            {
                Logging.LogRoomError(ex.ToString());
                return null;
            }
        }
コード例 #4
0
ファイル: RoomModel.cs プロジェクト: RootkitR/Essential-5.1
        public ServerMessage method_1(Room Room)
        {
            try
            {
                StringBuilder thatMessage = new StringBuilder();
                ServerMessage Message = new ServerMessage(Outgoing.HeightMap); // P
                string[] array = this.string_1.Split(new char[]
			{
				Convert.ToChar(13)
			});
                for (int i = 0; i < this.int_5; i++)
                {
                    if (i > 0)
                    {
                        array[i] = array[i].Substring(1);
                    }
                    for (int j = 0; j < this.int_4; j++)
                    {
                        string text = array[i].Substring(j, 1).Trim().ToLower();
                       
                        try
                        {
                            List<RoomItem> list = Room.method_93(j, i);
                            double num2 = Room.method_84(j, i, list);

                            if ((int)num2 < 10)
                            {
                                text = ((int)num2).ToString();
                            }
                            else
                            {
                                text = "0";
                            }
                        }
                      
                        catch
                        {

                        }
                      /*  foreach (RoomItem @class in Room.Hashtable_0.Values)
                        {
                            if (@class.GetX == i && @class.Int32_1 == j)
                            {
                                if ([email protected]().Stackable)
                                {
                                    text = "A";
                                    continue;
                                }

                            }
                        }
                        */
                        thatMessage.Append(text);
                    }
                    thatMessage.Append(string.Concat(Convert.ToChar(13)));
                }
                Message.AppendString(thatMessage.ToString());
             
                return Message;
            }
            catch (Exception ex)
            {
                Logging.LogRoomError(ex.ToString());
                return null;
            }
        }