mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 08:30:45 -05:00
49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using System;
|
|
using System.Reflection.Emit;
|
|
|
|
namespace SPT.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;
|
|
}
|
|
}
|
|
}
|