public static void SetInitListForBlacksmith() { if (itemTable != null && itemTable.Count > 0) { if (!itemTable.ContainsKey(table_blacksmith)) { return; } Hashtable parentTable = (Hashtable)itemTable [table_blacksmith]; foreach (string stringkey in parentTable.Keys) { //把每一行抓出來 Hashtable currenttable = (Hashtable)parentTable[stringkey]; BlackSmithAddition current_blacksmithaddition = new BlackSmithAddition(); current_blacksmithaddition.itemkey = stringkey; Dictionary <string, int> data = new Dictionary <string, int>(); data = CheckIfKeyGotValue(data, currenttable, key_blacksmithaddition_param1, key_blacksmithaddition_param1count); data = CheckIfKeyGotValue(data, currenttable, key_blacksmithaddition_param2, key_blacksmithaddition_param2count); data = CheckIfKeyGotValue(data, currenttable, key_blacksmithaddition_param3, key_blacksmithaddition_param3count); data = CheckIfKeyGotValue(data, currenttable, key_blacksmithaddition_param4, key_blacksmithaddition_param4count); current_blacksmithaddition.param = data; Utilities.DebugLog("Blacksmith now is " + stringkey); blacksmithadditioninfo_list.Add(current_blacksmithaddition); } } }
public static BlackSmithAddition FindBlackSmithAdditionByKey(string addtionkey) { if (blacksmithadditioninfo_list == null || blacksmithadditioninfo_list.Count == 0) { return(null); } BlackSmithAddition rblacksmithaddition = null; foreach (BlackSmithAddition blacksmithaddition in blacksmithadditioninfo_list) { if (blacksmithaddition.itemkey.CompareTo(addtionkey) == 0) { rblacksmithaddition = blacksmithaddition; break; } } return(rblacksmithaddition); }
// Use this for initialization void Start() { LoadingData.LoadItem(); Utilities.DebugLog("LoadingData.GetTabCount " + LoadingData.GetTabCount(LoadingData.table_equipment)); BlackSmithAddition getback = LoadingData.FindBlackSmithAdditionByKey(blacksmithfindkey); Equipment getback2 = LoadingData.FindEquipmentInfoByKey(equipmentfindkey); GameMaterial getback3 = LoadingData.FindMaterialByKey(materialfindkey); MissionPoint missionpointback = LoadingData.FindMissionByKey(missionpointfindkey); Stage stageback = LoadingData.FindStageByKey(stagefindkey); Alchemy alchemyback = LoadingData.FindAlchemyByKey(alchemyfindkey); Utilities.DebugLog("addition info " + getback.itemkey); Utilities.DebugLog("need add " + getback.param.Count + " item"); foreach (KeyValuePair <string, int> param in getback.param) { Utilities.DebugLog("addition key " + param.Key + " value " + param.Value); } Utilities.DebugLog("================================"); Utilities.DebugLog("weapon info " + getback2.equipmentkey); Utilities.DebugLog("weapon type " + getback2.type); Utilities.DebugLog("weapon price " + getback2.price_value); Utilities.DebugLog("material info " + getback3.itemkey); Utilities.DebugLog("weapon tw " + getback3.tw); Utilities.DebugLog("weapon desc " + getback2.tw_desc); Utilities.DebugLog("mission point now is " + missionpointback.key); Utilities.DebugLog("stageback now is " + stageback.key); Utilities.DebugLog("stageback point now is " + stageback.checkpointcount); Utilities.DebugLog("stageback king is " + stageback.kingname); Utilities.DebugLog("alchemyback now is " + alchemyback.itemkey); foreach (KeyValuePair <GameMaterial, int> param in alchemyback.param) { Utilities.DebugLog("addition key " + param.Key.tw + " value " + param.Value); } }