public override int Add(Blam.CacheIndex.Item tag) { int index = -1; tag_database_entry_block entry; if (!lookup.TryGetValue(tag.Datum, out entry)) // hey, not in the database { index = db.Entries.Count; // count will be the index of our new entry db.Entries.Add(out entry); // add a new entry entry.Name.Value = // set the name cacheFile.GetReferenceName(tag); entry.GroupTag.Value = tag.GroupTag.Tag; // set the group tag lookup.Add(tag.Datum, entry); // add entry to the dictionary return(entry.Flags.Value = index); } return(entry.Flags.Value); }
public override int Add(Blam.CacheIndex.Item tag) { int index = -1; Halo1.Tags.tag_database_entry_block entry; if (!lookup.TryGetValue(tag.Datum, out entry)) // hey, not in the database { string name = cacheFile.GetReferenceName(tag); index = db.Entries.Count; // count will be the index of our new entry db.Entries.Add(out entry); // add a new entry entry.Name.Value = // set the name System.Text.Encoding.ASCII.GetBytes(name); entry.GroupTag.Value = tag.GroupTag.Tag; // set the group tag entry.HandleDataHigh.Value = name.GetHashCode(); lookup.Add(tag.Datum, entry); // add entry to the dictionary return(entry.Flags.Value = index); } return(entry.Flags.Value); }