Пример #1
0
 /// <summary>Remove a tag to the extraction queue</summary>
 /// <param name="index"></param>
 public void Dequeue(DatumIndex index)
 {
     Datums[index] = true;
 }
Пример #2
0
        /// <summary>
        /// Get a tag index that is loaded in memory
        /// </summary>
        /// <param name="index_id">Handle for the tag index object</param>
        /// <returns></returns>
        public static Managers.ITagIndex GetTagIndex(Blam.DatumIndex index_id)
        {
            BlamVersion engine = Managers.BlamDefinition.TagIndexDatumToEngine(index_id);

            return(GetManager(engine).GetTagIndex(index_id));
        }
Пример #3
0
        /// <summary>
        /// Dispose a tag index from memory
        /// </summary>
        /// <param name="index_id">Handle for the tag index object</param>
        public static void CloseTagIndex(Blam.DatumIndex index_id)
        {
            BlamVersion engine = Managers.BlamDefinition.CacheDatumToEngine(index_id);

            GetManager(engine).CloseTagIndex(index_id);
        }
Пример #4
0
        /// <summary>
        /// Dispose a cache file from memory
        /// </summary>
        /// <param name="cache_id">Handle for the cache file object</param>
        public static void CloseCacheFile(Blam.DatumIndex cache_id)
        {
            BlamVersion engine = Managers.BlamDefinition.CacheDatumToEngine(cache_id);

            GetManager(engine).CloseCacheFile(cache_id);
        }
Пример #5
0
        /// <summary>
        /// Get a cache file that is loaded in memory
        /// </summary>
        /// <param name="cache_id">Handle for the cache file object</param>
        /// <returns></returns>
        public static Blam.CacheFile GetCacheFile(Blam.DatumIndex cache_id)
        {
            BlamVersion engine = Managers.BlamDefinition.CacheDatumToEngine(cache_id);

            return(GetManager(engine).GetCacheFile(cache_id));
        }
Пример #6
0
        /// <summary>
        /// Dispose a cache builder from memory
        /// </summary>
        /// <param name="builder_id">Handle for the cache builder object</param>
        public static void CloseCacheBuilder(Blam.DatumIndex builder_id)
        {
            BlamVersion engine = Managers.BlamDefinition.CacheBuilderDatumToEngine(builder_id);

            GetManager(engine).CloseCacheBuilder(builder_id);
        }
Пример #7
0
 /// <summary>
 /// Locate a tag index item based on a complete
 /// datum index held in a 32bit integer
 /// </summary>
 /// <param name="datum">integer holding the datum index</param>
 /// <remarks>Doesn't sanity check the datum, only gets the index</remarks>
 /// <returns>Tag index item associated with that datum index or null if its an invalid datum index</returns>
 public CacheIndex.Item LocateTagByDatum(int datum)
 {
     try { return(Index.Tags[DatumIndex.ToIndex(datum)]); }
     catch (Exception) { return(null); }
 }
Пример #8
0
        /// <summary>
        /// Get a <see cref="TagGroup"/> via a handle stored in a <see cref="DatumIndex"/> object which is a strong reference
        /// and can be trusted to work even when streamed to a file and loaded at another time after the application
        /// has reset
        /// </summary>
        /// <param name="group_handle">Strong reference to a <see cref="TagGroup"/></param>
        /// <returns></returns>
        public static TagGroup TagGroupFromHandle(DatumIndex group_handle)
        {
            if (group_handle == DatumIndex.Null)
            {
                return(TagGroup.Null);
            }

            BlamVersion engine    = (BlamVersion)group_handle.Salt;
            ushort      index     = group_handle.Index;
            bool        is_struct = Util.Flags.Test(index, (ushort)0x8000);

            switch (engine)
            {
            case BlamVersion.Halo1:
                return(Halo1.TagGroups.Groups[index]);

#if !NO_HALO2
            case BlamVersion.Halo2:
                if (is_struct)
                {
                    return(Halo2.StructGroups.Groups[index]);
                }
                return(Halo2.TagGroups.Groups[index]);
#endif

#if NO_HALO3
            case BlamVersion.Halo3:
                if (is_struct)
                {
                    return(Halo3.StructGroups.Groups[index]);
                }
                return(Halo3.TagGroups.Groups[index]);
#endif

#if NO_HALO_ODST
            case BlamVersion.HaloOdst:
                // TODO: ummm, add the code for struct groups
                //if (is_struct) return HaloOdst.StructGroups.Groups[index];
                return(HaloOdst.TagGroups.Groups[index]);
#endif

#if NO_HALO_REACH
            case BlamVersion.HaloReach:
                if (is_struct)
                {
                    return(HaloReach.StructGroups.Groups[index]);
                }
                return(HaloReach.TagGroups.Groups[index]);
#endif

#if NO_HALO4
            case BlamVersion.Halo4:
                if (is_struct)
                {
                    return(Halo4.StructGroups.Groups[index]);
                }
                return(Halo4.TagGroups.Groups[index]);
#endif

            case BlamVersion.Stubbs:
                return(Stubbs.TagGroups.Groups[index]);


            case BlamVersion.Unknown:
                return(MiscGroups.Groups[index]);

            default:
                throw new Debug.Exceptions.UnreachableException(engine);
            }
        }