0fda28526f
* Implement patch abstractions and patch loader using an interface * remove patch loader * rename patch class
47 lines
1.0 KiB
C#
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;
|
|
}
|
|
}
|