Ejemplo n.º 1
0
        public StringIndex(CacheFile cache)
        {
            if (cache == null)
            {
                throw new ArgumentNullException(nameof(cache));
            }

            this.cache = cache;
            items      = new string[cache.Header.StringCount];
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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>();
        }
Ejemplo n.º 4
0
        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());
        }
Ejemplo n.º 5
0
 public IndexItem(CacheFile cache)
 {
     this.cache = cache;
 }
Ejemplo n.º 6
0
 public HeaderAddressTranslator(CacheFile cache)
 {
     this.cache = cache;
 }
Ejemplo n.º 7
0
 public TagAddressTranslator(CacheFile cache)
 {
     this.cache = cache;
 }