Example #1
0
        public StringIndex(CacheFile cache)
        {
            if (cache == null)
            {
                throw new ArgumentNullException(nameof(cache));
            }

            this.cache = cache;
            items      = new string[cache.Header.StringCount];
            translator = new StringIdTranslator(Resources.MccHaloReachStrings, cache.Metadata.StringIds);
        }
Example #2
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>();

            Classes   = new List <TagClass>();
            Filenames = new Dictionary <int, string>();
        }
Example #3
0
        public PointerExpander(CacheFile cache)
        {
            switch (cache.BuildString)
            {
            case "Jun 24 2019 00:36:03":
            case "Jul 30 2019 14:17:16":
                magic = 0x10000000;
                break;

            default:
                magic = 0x50000000;
                break;
            }
        }
Example #4
0
        private void TestMap(string folder, string map)
        {
            var cache = new Adjutant.Blam.MccHaloReach.CacheFile(Path.Combine(folder, $"{map}.map"));

            var t0 = Task.Run(() =>
            {
                var gestalt     = cache.TagIndex.FirstOrDefault(t => t.ClassCode == "zone")?.ReadMetadata <cache_file_resource_gestalt>();
                var layoutTable = cache.TagIndex.FirstOrDefault(t => t.ClassCode == "play")?.ReadMetadata <cache_file_resource_layout_table>();

                return(true);
            });

            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);
            });

            Assert.IsTrue(t0.GetAwaiter().GetResult());
            Assert.IsTrue(t1.GetAwaiter().GetResult());
            Assert.IsTrue(t2.GetAwaiter().GetResult());
            Assert.IsTrue(t3.GetAwaiter().GetResult());
        }
Example #5
0
 public IndexItem(CacheFile cache, int index)
 {
     this.cache = cache;
     Id         = index;
 }