コード例 #1
0
        protected override void gameConfigCreate(string fileName, string name)
        {
            var cache = new ShareCacheStruct <ExchangeCode>();

            System.IO.StreamReader stream = new System.IO.StreamReader(fileName);
            string           line         = "";
            ExchangeCodeType type         = (ExchangeCodeType)System.Enum.Parse(typeof(ExchangeCodeType), name, true);

            if ((byte)type < 0 || (byte)type > byte.MaxValue)
            {
                ConsoleLog.showErrorInfo(0, "exchangeCode type:" + fileName);
            }
            int index = 0;

            while ((line = stream.ReadLine()) != null)
            {
                // TODO
                if (false == ExchangeCodeMgr.Instance().Add((int)type, index++, line))
                {
                    ConsoleLog.showNotifyInfo(name + ":has been added", ConsoleLog.ConsoleLogType.Debug);
                    break;
                }
            }
            stream.Close();
            ConsoleLog.showNotifyInfo(fileName + " is update to new version.");
        }
コード例 #2
0
 public static ExchangeCodeMgr Instance()
 {
     if (null == _instance)
     {
         _instance = new ExchangeCodeMgr();
         _instance.Init();
     }
     return(_instance);
 }
コード例 #3
0
ファイル: ExchangeCodeMgr.cs プロジェクト: guccang/scutlogic
 public static ExchangeCodeMgr Instance()
 {
     if (null == _instance)
     {
         _instance = new ExchangeCodeMgr();
         _instance.Init();
     }
     return _instance;
 }