public static TaskDailyObject Load(SecurityElement element) { TaskDailyObject taskDailyObject = new TaskDailyObject(); taskDailyObject.ID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Task_Daily_ID"), ""), -1); taskDailyObject.Logic_ID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Logic_ID"), ""), -1); taskDailyObject.Name = StrParser.ParseStr(element.Attribute("Name"), ""); taskDailyObject.Des = StrParser.ParseStr(element.Attribute("Des"), ""); taskDailyObject.Task_Category = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Task_Category"), ""), -1); taskDailyObject.Task_Type = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Task_Type"), ""), -1); taskDailyObject.Need_Count = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Count"), ""), -1); taskDailyObject.Reward_Exp = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Reward_Exp"), ""), -1); taskDailyObject.Reward_Money = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Reward_Money"), ""), -1); taskDailyObject.Reward_Ingot = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Reward_Ingot"), ""), -1); string rewardItemList = StrParser.ParseStr(element.Attribute("Reward_Item"), ""); if (rewardItemList != null && rewardItemList != "") { string[] vecs = rewardItemList.Split(','); taskDailyObject.RewardItemList.Clear(); foreach (string Conditionstring in vecs) { string [] datastring = Conditionstring.Split(':'); RewardData rewardData = new RewardData(); rewardData.ID = StrParser.ParseDecInt(datastring[0], -1); rewardData.Num = StrParser.ParseDecInt(datastring[1], -1); taskDailyObject.RewardItemList.Add(rewardData); } } string RewardskillList = StrParser.ParseStr(element.Attribute("Reward_Skill"), ""); if (RewardskillList != null && RewardskillList != "") { string[] vecs = rewardItemList.Split('|'); taskDailyObject.RewardSkillList.Clear(); foreach (string Conditionstring in vecs) { int data = StrParser.ParseDecInt(Conditionstring, -1); taskDailyObject.RewardSkillList.Add(data); } } taskDailyObject.Rarity_Level = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Rarity_Level"), ""), -1); taskDailyObject.Gift_Level = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Gift_Level"), ""), -1); // seedObject.Seed_Describe = StrParser.ParseStr(element.Attribute ("Seed_Describe"), ""); // seedObject.Seed_Icon = StrParser.ParseStr(element.Attribute ("Seed_Icon"), ""); // seedObject.Growth_Icon = StrParser.ParseStr(element.Attribute ("Growth_Icon"), ""); // seedObject.Blossom_Icon = StrParser.ParseStr(element.Attribute ("Blossom_Icon"), ""); // seedObject.Wilt_Icon = StrParser.ParseStr(element.Attribute ("Wilt_Icon"), ""); // seedObject.Grow_Time = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Grow_Time"),""),-1); // seedObject.Life_Time = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Life_Time"),""),-1); // seedObject._reward_Item = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Reward_Item"),""),-1); // seedObject._reward_Item_Count = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Reward_Item_Count"),""),-1); return(taskDailyObject); }
public override bool Load(SecurityElement element) { if (element.Tag != "Items") { return(false); } if (element.Children != null) { foreach (SecurityElement childrenElement in element.Children) { TaskDailyObject taskDailyObject = TaskDailyObject.Load(childrenElement); if (!_taskDailyObject.ContainsKey(taskDailyObject.ID)) { _taskDailyObject[taskDailyObject.ID] = taskDailyObject; } } } return(true); }