-
-
Notifications
You must be signed in to change notification settings - Fork 216
/
Copy pathIl2CppGenericParameter.cs
37 lines (31 loc) · 1.14 KB
/
Il2CppGenericParameter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Linq;
using LibCpp2IL.BinaryStructures;
namespace LibCpp2IL.Metadata;
public class Il2CppGenericParameter : ReadableClass
{
public int ownerIndex; /* Type or method this parameter was defined in. */
public int nameIndex;
public short constraintsStart;
public short constraintsCount;
public ushort genericParameterIndexInOwner;
public ushort flags;
public string? Name => LibCpp2IlMain.TheMetadata?.GetStringFromIndex(nameIndex);
public Il2CppType[]? ConstraintTypes => constraintsCount == 0
? []
: LibCpp2IlMain.TheMetadata?.constraintIndices
.Skip(constraintsStart)
.Take(constraintsCount)
.Select(LibCpp2IlMain.Binary!.GetType)
.ToArray();
public int Index { get; internal set; }
public override void Read(ClassReadingBinaryReader reader)
{
ownerIndex = reader.ReadInt32();
nameIndex = reader.ReadInt32();
constraintsStart = reader.ReadInt16();
constraintsCount = reader.ReadInt16();
genericParameterIndexInOwner = reader.ReadUInt16();
flags = reader.ReadUInt16();
}
}