/// <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); }
void ReadHeader(IO.EndianReader s, IO.ITagStream ts) { header = new tag_fieldset_header(); header.Read(s, ts); Type type_of = state.DefinitionType; VerifyHeaderGroupTag(ts, type_of); VerifyHeaderCount(ts, type_of); VerifyHeaderVersionIds(ts, type_of); }
public FieldSetVersioning(BlamVersion engine, FieldType container_type, DefinitionState state) { failureReason = VersioningFailureReason.None; relativeOffset = 0; expectedCount = 1; needsUpgrading = false; useImplicitUpgrading = false; header = new tag_fieldset_header(); this.type = container_type; this.state = state; if (container_type != FieldType.Struct) { this.headerGroupTag = Blam.MiscGroups.tbfd; } else { var groups = engine.VersionToStructCollection(); var sa = state.Attribute as StructAttribute; headerGroupTag = groups[sa.GroupIndex]; } }
/// <summary> /// Can the field-set be implicitly upgraded by just not reading some (supposedly) newer fields? /// </summary> /// <param name="header"></param> /// <param name="io_flags"></param> /// <returns></returns> bool VersioningCanBeImplicitlyPerformed(tag_fieldset_header header, Util.Flags io_flags) { int size_of = VersioningGetRealSizeOf(io_flags); return header.Index == attribute.Version && size_of > header.Size; }
public FieldSetVersioning(BlamVersion engine, FieldType container_type, DefinitionState state) { failureReason = VersioningFailureReason.None; relativeOffset = 0; expectedCount = 1; needsUpgrading = false; useImplicitUpgrading = false; header = new tag_fieldset_header(); this.type = container_type; this.state = state; if(container_type != FieldType.Struct) this.headerGroupTag = Blam.MiscGroups.tbfd; else { var groups = engine.VersionToStructCollection(); var sa = state.Attribute as StructAttribute; headerGroupTag = groups[sa.GroupIndex]; } }
/// <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; }
/// <summary> /// Can the field-set be implicitly upgraded by just not reading some (supposedly) newer fields? /// </summary> /// <param name="header"></param> /// <param name="io_flags"></param> /// <returns></returns> bool VersioningCanBeImplicitlyPerformed(tag_fieldset_header header, Util.Flags io_flags) { int size_of = VersioningGetRealSizeOf(io_flags); return(header.Index == attribute.Version && size_of > header.Size); }