From 52d3176f5c48a092bae86be6402c0cdcff6c5376 Mon Sep 17 00:00:00 2001 From: LukeFZ <17146677+LukeFZ@users.noreply.github.com> Date: Mon, 9 Feb 2026 20:15:56 +0100 Subject: [PATCH] remove unnecessary AddedVersion member in IIndexType --- .../Next/Metadata/DefaultValueDataIndex.cs | 1 - Il2CppInspector.Common/Next/Metadata/EventIndex.cs | 3 +-- Il2CppInspector.Common/Next/Metadata/FieldIndex.cs | 1 - .../Next/Metadata/GenericContainerIndex.cs | 1 - .../Next/Metadata/GenericParameterIndex.cs | 1 - Il2CppInspector.Common/Next/Metadata/IIndexType.cs | 8 +++----- Il2CppInspector.Common/Next/Metadata/InterfacesIndex.cs | 3 +-- Il2CppInspector.Common/Next/Metadata/MethodIndex.cs | 1 - Il2CppInspector.Common/Next/Metadata/NestedTypeIndex.cs | 3 +-- Il2CppInspector.Common/Next/Metadata/ParameterIndex.cs | 3 +-- Il2CppInspector.Common/Next/Metadata/PropertyIndex.cs | 3 +-- .../Next/Metadata/TypeDefinitionIndex.cs | 1 - Il2CppInspector.Common/Next/Metadata/TypeIndex.cs | 1 - 13 files changed, 8 insertions(+), 22 deletions(-) diff --git a/Il2CppInspector.Common/Next/Metadata/DefaultValueDataIndex.cs b/Il2CppInspector.Common/Next/Metadata/DefaultValueDataIndex.cs index e69b56a..57b7e70 100644 --- a/Il2CppInspector.Common/Next/Metadata/DefaultValueDataIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/DefaultValueDataIndex.cs @@ -7,7 +7,6 @@ public struct DefaultValueDataIndex(int value) : IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/EventIndex.cs b/Il2CppInspector.Common/Next/Metadata/EventIndex.cs index de37e60..5413c54 100644 --- a/Il2CppInspector.Common/Next/Metadata/EventIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/EventIndex.cs @@ -6,8 +6,7 @@ public struct EventIndex(int value) : IIndexType, IReadable, IEquata { public const string TagPrefix = nameof(EventIndex); - static string IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; + static string IIndexType.TagPrefix => TagPrefix; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/FieldIndex.cs b/Il2CppInspector.Common/Next/Metadata/FieldIndex.cs index d9050ed..244061a 100644 --- a/Il2CppInspector.Common/Next/Metadata/FieldIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/FieldIndex.cs @@ -7,7 +7,6 @@ public struct FieldIndex(int value) : IIndexType, IReadable, IEquata public const string TagPrefix = nameof(FieldIndex); static string IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/GenericContainerIndex.cs b/Il2CppInspector.Common/Next/Metadata/GenericContainerIndex.cs index dc45c84..bb78221 100644 --- a/Il2CppInspector.Common/Next/Metadata/GenericContainerIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/GenericContainerIndex.cs @@ -7,7 +7,6 @@ public struct GenericContainerIndex(int value) : IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/GenericParameterIndex.cs b/Il2CppInspector.Common/Next/Metadata/GenericParameterIndex.cs index dde565c..0e4c73a 100644 --- a/Il2CppInspector.Common/Next/Metadata/GenericParameterIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/GenericParameterIndex.cs @@ -7,7 +7,6 @@ public struct GenericParameterIndex(int value) : IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/IIndexType.cs b/Il2CppInspector.Common/Next/Metadata/IIndexType.cs index 80e664b..8c65c98 100644 --- a/Il2CppInspector.Common/Next/Metadata/IIndexType.cs +++ b/Il2CppInspector.Common/Next/Metadata/IIndexType.cs @@ -6,17 +6,15 @@ public interface IIndexType where T : IIndexType, allows ref struct { public static abstract string TagPrefix { get; } - public static abstract StructVersion AddedVersion { get; } private static string TagSize4 => $"{T.TagPrefix}4"; private static string TagSize2 => $"{T.TagPrefix}2"; private static string TagSize1 => $"{T.TagPrefix}1"; private static bool HasCustomSize(in StructVersion version) - => version >= T.AddedVersion - && version.Tag != null - && version.Tag.Contains(T.TagPrefix) - && !version.Tag.Contains(TagSize4); + => version.Tag != null + && (version.Tag.Contains(TagSize2) + || version.Tag.Contains(TagSize1)); public static int IndexSize(in StructVersion version = default, bool is32Bit = false) { diff --git a/Il2CppInspector.Common/Next/Metadata/InterfacesIndex.cs b/Il2CppInspector.Common/Next/Metadata/InterfacesIndex.cs index fdf8dc7..34c0d32 100644 --- a/Il2CppInspector.Common/Next/Metadata/InterfacesIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/InterfacesIndex.cs @@ -6,8 +6,7 @@ public struct InterfacesIndex(int value) : IIndexType, IReadabl { public const string TagPrefix = nameof(InterfacesIndex); - static string IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; + static string IIndexType.TagPrefix => TagPrefix; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/MethodIndex.cs b/Il2CppInspector.Common/Next/Metadata/MethodIndex.cs index a8b9990..a5dccb9 100644 --- a/Il2CppInspector.Common/Next/Metadata/MethodIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/MethodIndex.cs @@ -7,7 +7,6 @@ public struct MethodIndex(int value) : IIndexType, IReadable, IEqua public const string TagPrefix = nameof(MethodIndex); static string IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/NestedTypeIndex.cs b/Il2CppInspector.Common/Next/Metadata/NestedTypeIndex.cs index cf6051e..2d72b17 100644 --- a/Il2CppInspector.Common/Next/Metadata/NestedTypeIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/NestedTypeIndex.cs @@ -6,8 +6,7 @@ public struct NestedTypeIndex(int value) : IIndexType, IReadabl { public const string TagPrefix = nameof(NestedTypeIndex); - static string IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; + static string IIndexType.TagPrefix => TagPrefix; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/ParameterIndex.cs b/Il2CppInspector.Common/Next/Metadata/ParameterIndex.cs index 204f4e2..708f5b3 100644 --- a/Il2CppInspector.Common/Next/Metadata/ParameterIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/ParameterIndex.cs @@ -6,8 +6,7 @@ public struct ParameterIndex(int value) : IIndexType, IReadable, { public const string TagPrefix = nameof(ParameterIndex); - static string IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; + static string IIndexType.TagPrefix => TagPrefix; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/PropertyIndex.cs b/Il2CppInspector.Common/Next/Metadata/PropertyIndex.cs index 679d0c3..68f6dcd 100644 --- a/Il2CppInspector.Common/Next/Metadata/PropertyIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/PropertyIndex.cs @@ -6,8 +6,7 @@ public struct PropertyIndex(int value) : IIndexType, IReadable, I { public const string TagPrefix = nameof(PropertyIndex); - static string IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; + static string IIndexType.TagPrefix => TagPrefix; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/TypeDefinitionIndex.cs b/Il2CppInspector.Common/Next/Metadata/TypeDefinitionIndex.cs index ba73040..dbfcf3e 100644 --- a/Il2CppInspector.Common/Next/Metadata/TypeDefinitionIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/TypeDefinitionIndex.cs @@ -7,7 +7,6 @@ public struct TypeDefinitionIndex(int value) : IIndexType, public const string TagPrefix = nameof(TypeDefinitionIndex); static string IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; private int _value = value; diff --git a/Il2CppInspector.Common/Next/Metadata/TypeIndex.cs b/Il2CppInspector.Common/Next/Metadata/TypeIndex.cs index 8a2b3a8..23ceaae 100644 --- a/Il2CppInspector.Common/Next/Metadata/TypeIndex.cs +++ b/Il2CppInspector.Common/Next/Metadata/TypeIndex.cs @@ -7,7 +7,6 @@ public struct TypeIndex(int value) : IIndexType, IReadable, IEquatabl public const string TagPrefix = nameof(TypeIndex); static string IIndexType.TagPrefix => TagPrefix; - static StructVersion IIndexType.AddedVersion => MetadataVersions.V390; private int _value = value;