public static string GetValue(List <IncreaseString> increaseList, int step) { IncreaseString str = null; foreach (IncreaseString str2 in increaseList) { if (((str == null) || (str._fromStep <= str2._fromStep)) && (step >= str2._fromStep)) { str = str2; } } if (str == null) { return(""); } return(str._value); }
public string GetLevelDesc(int level) { return(IncreaseString.GetValue(this.levelDescs, level)); }
private Skill LoadSkillFromXml(SecurityElement element) { Skill skill = new Skill { id = StrParser.ParseHexInt(element.Attribute("Id"), 0), type = TypeNameContainer <CombatTurn._Type> .Parse(element.Attribute("Type"), 0), sortIndex = StrParser.ParseDecInt(element.Attribute("SortIndex"), 0), qualityLevel = StrParser.ParseDecInt(element.Attribute("QualityLevel"), 0) }; skill.uiPfxName = StrParser.ParseStr(element.Attribute("UIPfxName"), skill.uiPfxName); skill.needSkillScrollToRobShow = StrParser.ParseBool(element.Attribute("NeedSkillScrollToRobShow"), false); skill.activeableAssembleDesc = StrParser.ParseStr(element.Attribute("ActiveableAssembleDesc"), string.Empty); skill.isSuperSkill = StrParser.ParseBool(element.Attribute("IsSuperSkill"), false); skill.roleVoiceName = element.Attribute("RoleVoiceName"); if (element.Children != null) { foreach (SecurityElement element2 in element.Children) { string tag = element2.Tag; if (tag != null) { if (tag != "LevelDesc") { if (tag == "LevelModiferSets") { goto Label_0163; } if (tag == "GetWay") { goto Label_0176; } if (tag == "SkillUnlockDesc") { goto Label_0189; } if (tag == "PowerAttribute") { goto Label_019D; } } else { skill.levelDescs.Add(IncreaseString.LoadFromXml(element2)); } } continue; Label_0163: skill.levelModiferSets.Add(PropertyModifierSet.LoadFromXml(element2)); continue; Label_0176: skill.getways.Add(GetWay.LoadFromXml(element2)); continue; Label_0189: skill.skillUnlockDescs.Add(this.LoadSkillUnlockDescFromXml(element2)); continue; Label_019D: skill.powerAttributes = PowerAttribute.LoadFromXml(element2); } } return(skill); }