protected void AddOrUpdateTag(TagEntry tagEntry, int fileCount) { // initialise the mask for new entries if (tagEntry.FileMask == null) { tagEntry.FileMask = new BoolArray((uint)fileCount); } _TagEntries[tagEntry.Name] = tagEntry; }
protected void Add(string name, ushort typeId, int fileCount) { TagEntry tagEntry = new TagEntry() { Name = name, TypeId = typeId }; AddOrUpdateTag(tagEntry, fileCount); }
protected void ReadTags(BinaryReader br, uint tagCount, uint entryCount) { _TagEntries.EnsureCapacity((int)tagCount); for (int i = 0; i < tagCount; i++) { var tagEntry = new TagEntry(); tagEntry.Read(br, entryCount); _TagEntries.Add(tagEntry.Name, tagEntry); } }
/// <summary> /// Removes the specified TagEntry from the collection /// </summary> /// <param name="tagEntry"></param> public bool Remove(TagEntry tagEntry) => _TagEntries.Remove(tagEntry.Name);
/// <summary> /// Returns a TagEntry by name /// </summary> /// <param name="tag"></param> /// <param name="tagEntry"></param> /// <returns></returns> public bool TryGet(string tag, out TagEntry tagEntry) => _TagEntries.TryGetValue(tag, out tagEntry);
/// <summary> /// Removes the specified TagEntry from the collection /// </summary> /// <param name="tagEntry"></param> public void Remove(TagEntry tagEntry) => _TagEntries.Remove(tagEntry.Name);