Files
SPT-Server-Build/Libraries/SPTarkov.Reflection/CodeWrapper/Code.cs
T
Cj 0fda28526f Implement module patch abstraction and patch loader (#250)
* Implement patch abstractions and patch loader using an interface

* remove patch loader

* rename patch class
2025-05-11 20:52:14 +01:00

47 lines
1.0 KiB
C#

using System.Reflection.Emit;
namespace SPTarkov.Reflection.CodeWrapper;
public class Code
{
public OpCode OpCode { get; }
public Type? CallerType { get; }
public object? OperandTarget { get; }
public Type[]? Parameters { get; }
public bool HasOperand { get; }
public Code(OpCode opCode)
{
OpCode = opCode;
HasOperand = false;
}
public Code(OpCode opCode, object operandTarget)
{
OpCode = opCode;
OperandTarget = operandTarget;
HasOperand = true;
}
public Code(OpCode opCode, Type callerType)
{
OpCode = opCode;
CallerType = callerType;
HasOperand = true;
}
public Code(OpCode opCode, Type callerType, object operandTarget, Type[] parameters = null)
{
OpCode = opCode;
CallerType = callerType;
OperandTarget = operandTarget;
Parameters = parameters;
HasOperand = true;
}
public virtual Label? GetLabel()
{
return null;
}
}