unify logic for getting element type index
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user