Example #1
0
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, BallInfo> dictionary  = BallMgr.LoadFromDatabase();
         Dictionary <int, Tile>     dictionary2 = BallMgr.LoadFromFiles(dictionary);
         if (dictionary.Values.Count > 0 && dictionary2.Values.Count > 0)
         {
             Interlocked.Exchange <Dictionary <int, BallInfo> >(ref BallMgr.m_infos, dictionary);
             Interlocked.Exchange <Dictionary <int, Tile> >(ref BallMgr.m_tiles, dictionary2);
             return(true);
         }
     }
     catch (Exception exception)
     {
         BallMgr.log.Error("Ball Mgr init error:", exception);
     }
     return(false);
 }
Example #2
0
        public static bool ReLoad()
        {
            bool result;

            try
            {
                Dictionary <int, BallInfo> tempBalls    = BallMgr.LoadFromDatabase();
                Dictionary <int, Tile>     tempBallTile = BallMgr.LoadFromFiles(tempBalls);
                if (tempBalls.Values.Count > 0 && tempBallTile.Values.Count > 0)
                {
                    Interlocked.Exchange <Dictionary <int, BallInfo> >(ref BallMgr.m_infos, tempBalls);
                    Interlocked.Exchange <Dictionary <int, Tile> >(ref BallMgr.m_tiles, tempBallTile);
                    result = true;
                    return(result);
                }
            }
            catch (Exception ex)
            {
                BallMgr.log.Error("Ball Mgr init error:", ex);
            }
            result = false;
            return(result);
        }
Example #3
0
 public static bool Init()
 {
     return(BallMgr.ReLoad());
 }