public void parses_value_for_exp() { const string data = "<component id='exp Sorcery'> Sorcery: 321 56% learning </component>"; var tag = new ComponentTag(data); Assert.AreEqual("Sorcery", tag.Id); Assert.AreEqual("321 56% learning", tag.Value); Assert.True(tag.IsExp); }
public void parses_id_for_exp() { const string data = "<component id='exp Elemental Magic'><preset id='whisper'> Elemental Magic: 12 17% dabbling </preset></component>"; var tag = new ComponentTag(data); Assert.AreEqual("Elemental_Magic", tag.Id); Assert.AreEqual("12 17% dabbling", tag.Value); Assert.True(tag.IsNewExp); Assert.True(tag.IsExp); }
public void parses_attunement() { const string data = "<component id='exp Attunement'><preset id='whisper'> Attunement: 25 86% very focused </preset></component>"; var tag = new ComponentTag(data); Assert.AreEqual("Attunement", tag.Id); Assert.AreEqual("25 86% very focused", tag.Value); Assert.True(tag.IsNewExp); Assert.True(tag.IsExp); }
public static SkillExp For(ComponentTag tag) { var exp = new SkillExp(); exp.Name = tag.Id; exp.Ranks = Regex.Replace(tag.Value, Rank_Regex, "$1.$2"); var mindState = Regex.Replace(tag.Value, Rank_Regex, "$3"); exp.LearningRate = LearningRate.For(mindState); exp.IsNew = tag.IsNewExp; return exp; }
public static ComponentTag RoomExistsFor(ComponentTag tag) { tag.Value = Regex.Replace(tag.Value, "<[^>]*>", string.Empty).TrimStart(); return tag; }