public ResourceObject[] GetCachedResourceObjects(RESOURCE_CATEGORY category, string[] resource_names) { if (objectCaches == null) { return(null); } StringKeyTable <ResourceObject> stringKeyTable = objectCaches[(int)category]; if (stringKeyTable == null) { return(null); } ResourceObject[] array = new ResourceObject[resource_names.Length]; int i = 0; for (int num = resource_names.Length; i < num; i++) { string res_name = resource_names[i]; array[i] = stringKeyTable.Get(res_name); if (array[i] == null) { array[i] = systemCaches.Find((ResourceObject o) => o.obj.get_name() == res_name); } } return(array); }
public void CreateTable(string csv_text, bool encrypted) { stringKeyTable = new StringKeyTable <UIntKeyTable <string> >(); CSVReader cSVReader = new CSVReader(csv_text, "category,id,strJP", encrypted); UIntKeyTable <string> uIntKeyTable = null; while (cSVReader.NextLine()) { string value = string.Empty; cSVReader.Pop(ref value); if (value.Length > 0) { uIntKeyTable = stringKeyTable.Get(value); if (uIntKeyTable == null) { uIntKeyTable = new UIntKeyTable <string>(); stringKeyTable.Add(value, uIntKeyTable); } } if (uIntKeyTable != null) { uint value2 = 0u; bool flag = cSVReader.Pop(ref value2); string value3 = string.Empty; bool flag2 = cSVReader.Pop(ref value3); if (flag && value3.Length != 0) { uIntKeyTable.Add(value2, value3); } } } stringKeyTable.TrimExcess(); }
public void CreateTable(string csv) { if (!Singleton <EnemyHitTypeTable> .IsValid() || Singleton <EnemyHitTypeTable> .I.dataTable == null) { Log.Error(LOG.INGAME, "EnemyHitMaterialTable::CreateTable() Err ( EnemyHitTypeTable is invalid. )"); } else { typeKeyTable = new List <string>(); Singleton <EnemyHitTypeTable> .I.dataTable.ForEachKeys(delegate(string key) { if (key.IndexOf("@") < 0) { typeKeyTable.Add(key); } }); string text = string.Empty; int i = 0; for (int count = typeKeyTable.Count; i < count; i++) { text = text + "se_id_" + typeKeyTable[i]; if (i != count - 1) { text += ","; } } string name_table = "name,se_id_,add_effect_name".Replace("se_id_", text); dataTable = TableUtility.CreateStringKeyTable <MaterialData>(csv, MaterialData.cb, name_table); dataTable.TrimExcess(); } }
public ResourceObject GetCachedResourceObject(RESOURCE_CATEGORY category, string resource_name) { if (objectCaches == null) { return(null); } StringKeyTable <ResourceObject> stringKeyTable = objectCaches[(int)category]; if (stringKeyTable == null) { return(null); } ResourceObject resourceObject = stringKeyTable.Get(resource_name); if (resourceObject == null) { resourceObject = systemCaches.Find((ResourceObject o) => o.obj.get_name() == resource_name); } return(resourceObject); }
public static StringKeyTable <T> CreateStringKeyTable <T>(string text, CallBackStringKeyReadCSV <T> cb, string name_table) where T : new() { StringKeyTable <T> stringKeyTable = new StringKeyTable <T>(); CSVReader cSVReader = new CSVReader(text, name_table, false); while (cSVReader.NextLine()) { string value = string.Empty; if ((bool)cSVReader.Pop(ref value) && value.Length > 0) { T val = new T(); if (!cb(cSVReader, val, ref value)) { stringKeyTable.Clear(); return(null); } stringKeyTable.Add(value, val); } } return(stringKeyTable); }
public void CreateTable(string csv_text) { dataTable = TableUtility.CreateStringKeyTable <StageData>(csv_text, StageData.cb, "name,scene,ground,sky,attributeID,cameraLinkEffect,cameraLinkEffectY0,rootEffect,useEffect0,useEffect1,useEffect2,useEffect3,useEffect4,useEffect5,useEffect6,useEffect7"); dataTable.TrimExcess(); }
public void CreateTable(string csv) { dataTable = TableUtility.CreateStringKeyTable <TypeData>(csv, TypeData.cb, "name,base_effect,fire_effect,water_effect,thunder_effect,soil_effect,light_effect,dark_effect"); dataTable.TrimExcess(); }