Beispiel #1
0
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, LevelInfo> dictionary = new Dictionary <int, LevelInfo>();
         if (LevelMgr.LoadLevel(dictionary))
         {
             LevelMgr.m_lock.AcquireWriterLock(15000);
             try
             {
                 LevelMgr._levels = dictionary;
                 return(true);
             }
             catch
             {
             }
             finally
             {
                 LevelMgr.m_lock.ReleaseWriterLock();
             }
         }
     }
     catch (Exception exception)
     {
         if (LevelMgr.log.IsErrorEnabled)
         {
             LevelMgr.log.Error("LevelMgr", exception);
         }
     }
     return(false);
 }
Beispiel #2
0
        public static bool Init()
        {
            bool result;

            try
            {
                LevelMgr.m_lock  = new ReaderWriterLock();
                LevelMgr._levels = new Dictionary <int, LevelInfo>();
                LevelMgr.rand    = new ThreadSafeRandom();
                result           = LevelMgr.LoadLevel(LevelMgr._levels);
            }
            catch (Exception exception)
            {
                if (LevelMgr.log.IsErrorEnabled)
                {
                    LevelMgr.log.Error("LevelMgr", exception);
                }
                result = false;
            }
            return(result);
        }