unify logic for getting element type index

This commit is contained in:
LukeFZ
2025-07-21 17:06:16 +02:00
parent 8055ed1cdb
commit 893d2c1300
4 changed files with 9 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
using System.Reflection;
using VersionedSerialization;
using VersionedSerialization.Attributes;
namespace Il2CppInspector.Next.Metadata;
@@ -82,4 +83,9 @@ public partial record struct Il2CppTypeDefinition
public uint Token { get; private set; }
public readonly bool IsValid => NameIndex != 0;
public int GetEnumElementTypeIndex(StructVersion version)
=> version >= MetadataVersions.V350
? ParentIndex
: ElementTypeIndex;
}