/// <summary> /// Create a new builder tag index /// </summary> /// <param name="version">Engine version for the tags</param> /// <param name="source_index"></param> /// <remarks> /// Must call <see cref="DataArraySet"/> in inheriting object's ctor /// </remarks> protected BuilderTagIndexBase(BlamVersion version, Managers.ITagIndex source_index) { Debug.Assert.If(source_index, "Couldn't create a builder tag index! Require a valid source index."); Debug.Assert.If(source_index.Engine == version, "Couldn't create a builder tag index! Engine mismatch: {0:X} != {1:X}.", source_index.Engine, version); engine = version; sourceIndex = source_index; refManager = new Managers.ReferenceManager(version, string.Format("[BuilderTagIndex {0}]", version.ToString("X")), false); if (engine.UsesStringIds()) { StringTableInitialize(); } }
public BuilderTagIndex(BlamVersion version, Managers.ITagIndex source_index) : base(version, source_index) { int max_tag_count = 1024; var g = Program.GetManager(version).FindGame(version); if (g != null) { max_tag_count = g.Tags.MaxCount; } Array = new Managers.DataArray <BuilderItem>(max_tag_count, "builder tag instances"); DataArraySet(Array); }
/// <summary> /// Removes all tags from the index completely, disregarding /// any other cases (IE, multiple references to the tag) /// </summary> public void UnloadAll() { sourceIndex = null; dataArray.CloseAll(); refManager.Clear(); }