internal override void SetQuery <T>(TagQuery query, T val, bool bypassCheck) { TagQueryToken token = null; if (!bypassCheck) { token = query.Next(); if (token != null && !token.Name.Equals(Name)) { return; } } TagQueryToken nextToken = query.Peek(); if (nextToken != null) { NbtTag nextTag = Get(nextToken.Name); if (nextTag == null) { return; } nextTag.SetQuery <T>(query, val, false); Set(nextToken.Name, nextTag); return; } }
internal override T Query <T>(TagQuery query, bool bypassCheck) { TagQueryToken token = null; if (!bypassCheck) { token = query.Next(); if (token != null && !token.Name.Equals(Name)) { return(null); } } TagQueryToken nextToken = query.Peek(); if (nextToken != null) { NbtTag nextTag = Get(nextToken.Name); if (nextTag == null) { return(null); } return(nextTag.Query <T>(query)); } return((T)((NbtTag)this)); }
public void Set(int tagIdx, NbtTag tag) { if (tagIdx > Tags.Count) { throw new IndexOutOfRangeException(); } Tags[tagIdx] = tag; }
public void Set(string tagName, NbtTag tag) { if (!mTags.ContainsKey(tagName)) { mTags.Add(tagName, tag); } tag.Name = tagName; // Just make sure. mTags[tagName] = tag; }
public void Set(int tagIdx, NbtTag value) { if (tagIdx >= mTagIndices.Count) { throw new KeyNotFoundException(); } string k = mTagIndices[tagIdx]; Set(k, value); }
public void Add(string tagName, NbtTag tag) { if (mTags.ContainsKey(tagName)) { Set(tagName, tag); return; } tag.Name = tagName; // Just make sure. mTags.Add(tagName, tag); mTagIndices.Add(tagName); }
public void Set(string tagName, NbtTag tag) { foreach (var tg in Tags) { if (tg.Name.Equals(tagName)) { int idx = Tags.IndexOf(tg); Tags[idx] = tag; if (TagCache.ContainsKey(tagName)) { TagCache[tagName] = tag; } return; } } }
public void Set(int tagIdx, NbtTag tag) { Tags[tagIdx] = tag; }
public void Add(NbtTag tag) { Tags.Add(tag); }
public void Remove(NbtTag tag) { Remove(tag.Name); }
public void Add(NbtTag tag) { Add(tag.Name, tag); }