コード例 #1
0
        /// <summary>
        /// Is the field-set size (ignores version indices) equal to the latest definition's, taking
        /// into account things like
        /// </summary>
        /// <param name="header"></param>
        /// <param name="io_flags"></param>
        /// <param name="expected_size"></param>
        /// <returns></returns>
        bool VersioningSizeIsValid(tag_fieldset_header header, Util.Flags io_flags, out int expected_size)
        {
            bool useless        = io_flags.Test(IO.ITagStreamFlags.Halo2OldFormat_UselessPadding);
            bool old_string_ids = io_flags.Test(IO.ITagStreamFlags.Halo2OldFormat_StringId);

            int size_of = VersioningGetRealSizeOf(io_flags);

            expected_size = size_of;

            return(header.Size == size_of);
        }
コード例 #2
0
 /// <summary>
 /// If the tag manager upgraded the tag, this will set <paramref name="tag_def"/> to
 /// the object we're now managing, then clears the <see cref="IO.ITagStreamFlags.DefinitionWasUpgraded"/> bit
 /// in <see cref="Flags"/>
 /// </summary>
 /// <typeparam name="T"><see cref="BlamLib.TagInterface.Definition"/></typeparam>
 /// <param name="tag_def"></param>
 public void Resync <T>(ref T tag_def) where T : Definition
 {
     if (flags.Test(IO.ITagStreamFlags.DefinitionWasUpgraded))
     {
         tag_def = (T)tagDefinition;
         flags.Remove(IO.ITagStreamFlags.DefinitionWasUpgraded);
     }
 }