1 using System.Globalization;
9 private readonly Range<float> levelRange;
10 private readonly Range<float> levelRangePvP;
23 levelRange = GetSkillRange(
"level", element, defaultValue:
new Range<float>(0, 0));
24 levelRangePvP = GetSkillRange(
"pvplevel", element, defaultValue: levelRange);
27 static Range<float> GetSkillRange(
string attributeName,
ContentXElement element, Range<float> defaultValue)
30 if (levelString.Contains(
','))
32 var rangeVector2 = XMLExtensions.ParseVector2(levelString,
false);
33 return new Range<float>(rangeVector2.X, rangeVector2.Y);
35 else if (
float.TryParse(levelString, NumberStyles.Any, CultureInfo.InvariantCulture, out
float skillLevel))
37 return new Range<float>(skillLevel, skillLevel);
48 return isPvP ? levelRangePvP : levelRange;
string? GetAttributeString(string key, string? def)
float GetAttributeFloat(string key, float def)
bool GetAttributeBool(string key, bool def)
Identifier GetAttributeIdentifier(string key, string def)
readonly float PriceMultiplier
How much this skill affects characters' hiring cost
SkillPrefab(ContentXElement element)
readonly Identifier Identifier
Range< float > GetLevelRange(bool isPvP)