Beispiel #1
0
        public static T GetJson <T>() where T : IConfData
        {
            Type type = typeof(T);

            IConfData json = null;

            if (!m_jsnPool.TryGetValue(type, out json))
            {
                GameLog.Error(string.Format("Json {0} 不存在", type.Name));
                return(default(T));
            }

            return((T)json);
        }
Beispiel #2
0
        public static T GetIni <T>() where T : IConfData
        {
            Type type = typeof(T);

            IConfData ini = null;

            if (!m_iniPool.TryGetValue(type, out ini))
            {
                GameLog.Error(string.Format("Ini {0} 不存在", type.Name));
                return(default(T));
            }

            return((T)ini);
        }
Beispiel #3
0
        public static bool RemoveJson <T>() where T : IConfData
        {
            bool result = true;

            Type type = typeof(T);

            IConfData json = null;

            if (m_jsnPool.TryGetValue(type, out json))
            {
                result = m_iniPool.Remove(type);
            }

            return(result);
        }
Beispiel #4
0
        public static bool RemoveIni <T>() where T : IConfData
        {
            bool result = true;

            Type type = typeof(T);

            IConfData ini = null;

            if (m_iniPool.TryGetValue(type, out ini))
            {
                result = m_iniPool.Remove(type);
            }

            return(result);
        }
Beispiel #5
0
        public static T GetTab <T>(string key) where T : IConfData
        {
            Type type = typeof(T);

            Dictionary <string, IConfData> tabPool = null;

            if (!m_tabPools.TryGetValue(type, out tabPool))
            {
                GameLog.Error(string.Format("{0} 不存在", type.Name));
                return(default(T));
            }

            IConfData tab = null;

            if (!tabPool.TryGetValue(key, out tab))
            {
                GameLog.Error(string.Format("{0} 表不存在Key {1}", type.Name, key));
                return(default(T));
            }

            return((T)tab);
        }