Exemple #1
0
        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;
        }
Exemple #2
0
        protected void Add(string name, ushort typeId, int fileCount)
        {
            TagEntry tagEntry = new TagEntry()
            {
                Name   = name,
                TypeId = typeId
            };

            AddOrUpdateTag(tagEntry, fileCount);
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
 /// <summary>
 /// Removes the specified TagEntry from the collection
 /// </summary>
 /// <param name="tagEntry"></param>
 public bool Remove(TagEntry tagEntry) => _TagEntries.Remove(tagEntry.Name);
Exemple #5
0
 /// <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);
Exemple #6
0
 /// <summary>
 /// Removes the specified TagEntry from the collection
 /// </summary>
 /// <param name="tagEntry"></param>
 public void Remove(TagEntry tagEntry) => _TagEntries.Remove(tagEntry.Name);