Пример #1
0
 public void LoadMap()
 {
     foreach (ServerMap map in _maps.Values)
     {
         map.Dispose();
     }
     _maps.Clear();
     if (File.Exists("RK.save"))
     {
         ServerMap map = ServerMap.LoadFromFile("RK.save");
         _maps.Add(map.Id, map);
     }
 }
Пример #2
0
        internal static void TestMapWindowGetPerf()
        {
            using (ServerMap serverMap = ServerMap.LoadFromFile("RK.save"))
            {
                ServerMap map = serverMap;

                HRTimer timer = HRTimer.CreateAndStart();

                for (int i = 0; i < 100; i++)
                {
                    int startX = 0, startY = 0;
                    int wWidth = 150, wHeight = 150;
                    map.GetWindow(startX, startY, wWidth, wHeight);
                }
                System.Console.WriteLine(timer.StopWatch());
            }
        }