public StringIndex(CacheFile cache) { if (cache == null) { throw new ArgumentNullException(nameof(cache)); } this.cache = cache; items = new string[cache.Header.StringCount]; }
public BSPAddressTranslator(CacheFile cache, int id) { var bspData = cache.TagIndex.GetGlobalTag("scnr").ReadMetadata <scenario>().StructureBsps.SingleOrDefault(i => (i.BspReference.TagId) == id); if (bspData == null) { throw new InvalidOperationException(); } data = bspData; }
public TagIndex(CacheFile cache) { if (cache == null) { throw new ArgumentNullException(nameof(cache)); } this.cache = cache; items = new Dictionary <int, IndexItem>(); sysItems = new Dictionary <string, IndexItem>(); Filenames = new Dictionary <int, string>(); }
private void TestMap(string map) { var cache = new Adjutant.Blam.Halo2.CacheFile(Path.Combine(MapsFolder, $"{map}.map")); var t1 = Task.Run(() => { var bitmaps = cache.TagIndex.Where(i => i.ClassCode == "bitm") .Select(i => i.ReadMetadata <bitmap>()) .ToList(); return(true); }); var t2 = Task.Run(() => { var models = cache.TagIndex.Where(i => i.ClassCode == "mode") .Select(i => i.ReadMetadata <render_model>()) .ToList(); return(true); }); var t3 = Task.Run(() => { var bsps = cache.TagIndex.Where(i => i.ClassCode == "sbsp") .Select(i => i.ReadMetadata <scenario_structure_bsp>()) .ToList(); return(true); }); var t4 = Task.Run(() => { var bsps = cache.TagIndex.Where(i => i.ClassCode == "snd!") .Select(i => i.ReadMetadata <sound>()) .ToList(); return(true); }); Assert.IsTrue(t1.GetAwaiter().GetResult()); Assert.IsTrue(t2.GetAwaiter().GetResult()); Assert.IsTrue(t3.GetAwaiter().GetResult()); Assert.IsTrue(t4.GetAwaiter().GetResult()); }
public IndexItem(CacheFile cache) { this.cache = cache; }
public HeaderAddressTranslator(CacheFile cache) { this.cache = cache; }
public TagAddressTranslator(CacheFile cache) { this.cache = cache; }