Beispiel #1
0
        public static List <int> QueryIntList(string type, List <int> defaultValue = null)
        {
            TDRemoteConfig td = GetData(type);

            if (td != null)
            {
                return(Helper.String2ListInt(td.value, "#"));
            }

            return(defaultValue);
        }
Beispiel #2
0
        public static string QueryString(string type, string defaultValue = "")
        {
            TDRemoteConfig td = GetData(type);

            if (td != null)
            {
                return(td.value);
            }

            return(defaultValue);
        }
Beispiel #3
0
        public static float QueryFloat(string type, float defaultValue = 0)
        {
            TDRemoteConfig td = GetData(type);

            if (td != null)
            {
                return(Helper.String2Float(td.value));
            }

            return(defaultValue);
        }
 private static void OnAddRow(TDRemoteConfig memberInstance)
 {
     string key = memberInstance.id;
     if (m_DataCache.ContainsKey(key))
     {
         Log.e(string.Format("Invaild,  TDRemoteConfigTable Id already exists {0}", key));
     }
     else
     {
         m_DataCache.Add(key, memberInstance);
         m_DataList.Add(memberInstance);
     }
 }    
        public static void Parse(byte[] fileData)
        {
            m_DataCache.Clear();
            m_DataList.Clear();
            DataStreamReader dataR = new DataStreamReader(fileData);
            int rowCount = dataR.GetRowCount();
            int[] fieldIndex = dataR.GetFieldIndex(TDRemoteConfig.GetFieldHeadIndex());
    #if (UNITY_STANDALONE_WIN) || UNITY_EDITOR || UNITY_STANDALONE_OSX
            dataR.CheckFieldMatch(TDRemoteConfig.GetFieldHeadIndex(), "RemoteConfigTable");
    #endif
            for (int i = 0; i < rowCount; ++i)
            {
                TDRemoteConfig memberInstance = new TDRemoteConfig();
                memberInstance.ReadRow(dataR, fieldIndex);
                OnAddRow(memberInstance);
                memberInstance.Reset();
                CompleteRowAdd(memberInstance);
            }

            Log.i(string.Format("Parse Success TDRemoteConfig"));
        }
Beispiel #6
0
 static void CompleteRowAdd(TDRemoteConfig tdData)
 {
 }