private void parse(KeyValue abilsValue) { foreach (var kv in abilsValue.Children) { if (kv.Type == KvType.ParentKey) { Abilities.Add(new AbilityClass() { Name = kv.Key, AbilityValues = kv, }); } } }
private void parse(KeyValue heroeKeyValues) { foreach (var kv in heroeKeyValues.Children) { if (kv.Type == KvType.ParentKey) { Heroes.Add(new HeroClass() { Name = kv.Key, HeroValues = kv, }); } } }
private static List<KeyValue> ParseIt(string code, ref int n, KeyValue parent) { List<KeyValue> keys = new List<KeyValue>(); Token tok = new Token() {Tok = Toks.nil}; while (tok.Tok != Toks.eof) { tok = GetToken(code, ref n); if(tok.Tok == Toks.eof) break; if (tok.Tok == Toks.closeAngleBracket) { return keys.Count > 0 ? keys : null; } string key = tok.Value; tok = GetToken(code, ref n); string value = tok.Value; KeyValue KValue = new KeyValue() { Key = key, Parent = parent, Value = value, }; if (tok.Tok == Toks.openAngleBracket) { KValue.Type = KvType.ParentKey; KValue.Children = ParseIt(code, ref n, KValue); } else { KValue.Type = KvType.KeyValue; } keys.Add(KValue); } return keys; }
private void parseTokens(ref LocalizationFileClass fileClass, KeyValue key) { fileClass.Language = key.Children[0].Value; fileClass.Keys = key; fileClass.LocalizationKeys = key.Children[1]; }
private bool isAura(KeyValue modKv) { //if(modKv.HasKeyInChildren("IsHidden")) // if (modKv.FindChildren("IsHidden").Value == "1") // return false; if (modKv.HasKeyInChildren("Aura")) return true; if (modKv.HasKeyInChildren("IsDebuff")) if (modKv.FindChildren("IsDebuff").Value == "1") return true; if (modKv.HasKeyInChildren("IsBuff")) if (modKv.FindChildren("IsBuff").Value == "1") return true; return false; }