コード例 #1
0
 public TagAnalyzer(TagCacheHaloOnline cache)
 {
     _cache = cache;
     foreach (var group in cache.NonNull().Select(t => t.Group.Tag).Distinct())
     {
         _tagGroups.Add(group);
     }
 }
コード例 #2
0
        public GameCacheModPackage(FileInfo file)
        {
            ModPackageFile = file;
            Version        = CacheVersion.HaloOnline106708;
            Endianness     = EndianFormat.LittleEndian;
            Deserializer   = new TagDeserializer(Version);
            Serializer     = new TagSerializer(Version);
            Directory      = file.Directory;

            // load mod package
            BaseModPackage = new ModPackage(file);
            DisplayName    = BaseModPackage.Metadata.Name + ".pak";

            ResourceCaches        = new ResourceCachesModPackage(BaseModPackage);
            TagCacheGenHO         = new TagCacheHaloOnline(BaseModPackage.TagCachesStreams[0], BaseModPackage.TagCacheNames[0]);
            StringTableHaloOnline = BaseModPackage.StringTable;
        }
コード例 #3
0
        public TagCacheHaloOnline CreateTagCache(DirectoryInfo directory, out FileInfo file)
        {
            if (directory == null)
            {
                directory = Directory;
            }

            if (!directory.Exists)
            {
                directory.Create();
            }

            file = new FileInfo(Path.Combine(directory.FullName, "tags.dat"));

            TagCacheHaloOnline cache = null;

            using (var stream = file.Create())
                cache = CreateTagCache(stream);

            return(cache);
        }
コード例 #4
0
        public ModPackage(FileInfo file = null)
        {
            if (file != null)
            {
                Load(file);
            }
            else
            {
                // init a single cache
                var tagStream = new MemoryStream();
                TagCachesStreams.Add(tagStream);

                var names = new Dictionary <int, string>();
                var tags  = new TagCacheHaloOnline(tagStream, names);
                TagCaches = new List <TagCacheHaloOnline>();
                TagCaches.Add(tags);
                TagCacheNames.Add(names);
                Files = new Dictionary <string, Stream>();

                Resources           = new ResourceCacheHaloOnline(CacheVersion.HaloOnline106708, ResourcesStream);
                Header.SectionTable = new ModPackageSectionTable();
            }
        }