Пример #1
0
        //从配置代码中获取数据
        public IConfig SearchIdByConf(DBName db, int id)
        {
            CDataBase database = null;

            if (databaseMap.TryGetValue(db, out database))
            {
                database = databaseMap [db];
            }
            else
            {
                var ch = new List <IConfig>();
                if (db == DBName.PropsConfig)
                {
                    foreach (PropsConfigData p in GameData.PropsConfig)
                    {
                        ch.Add(p);
                    }
                }
                else if (db == DBName.EquipConfig)
                {
                    foreach (EquipConfigData p in GameData.EquipConfig)
                    {
                        ch.Add(p);
                    }
                }
                else if (db == DBName.ChapterConfig)
                {
                    foreach (ChapterConfigData p in GameData.ChapterConfig)
                    {
                        ch.Add(p);
                    }
                }
                database = new CDataBase(ch);
            }

            return(database.SearchIdByConf(id));
        }
Пример #2
0
        public CDataBase GetDataBase(List <IConfig> conf)
        {
            CDataBase database = new CDataBase(conf);

            return(database);
        }