Esempio n. 1
0
        /// <summary>
        /// 获取对应的配置
        /// </summary>
        public Dictionary <string, T> GetConfig <T> () where T : BaseConfigData
        {
            Type         type   = typeof(T);
            ParsedConfig config = mConfigs.ContainsKey(type) ? mConfigs[type] : ParseConfigFile <T>();

            return(config.GetDatas <T>());
        }
Esempio n. 2
0
        /**
         * 解析 SystemConfigFile 根据映射关系加载对应的配置
         */
        private ParsedConfig ParseConfigFile <T> () where T : BaseConfigData
        {
            Type type = typeof(T);

            SystemConfigFile fileConfig = mConfigFileCfg.GetData <SystemConfigFile>(type.FullName);

            ParsedConfig parsedConfig = new ParsedConfig(ReadCSVData <T>(fileConfig.filePath));

            mConfigs.Add(type, parsedConfig);

            return(parsedConfig);
        }
Esempio n. 3
0
 /**
  * 初始化,call by GameFramework
  * 会加载 mConfigFileCfg , 并加载其中标记为 initFirst 的配置
  */
 public override void Init()
 {
     base.Init();
     mConfigFileCfg = new ParsedConfig(ReadCSVData <SystemConfigFile>(ConfigServieCfg.CONFIG_FILES));
 }