From 2b48c3e3192c78344581c63a973bb82443726c67 Mon Sep 17 00:00:00 2001 From: Mikhail Mitrofanov Date: Mon, 3 Mar 2025 07:53:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=B0=D0=B7=D0=B0=20=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2=D0=B0=20=D0=BC=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B4=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mROA/Abstract/IMethodInvoker.cs | 13 +++++++++++++ mROA/Implementation/MethodInvoker.cs | 19 +++++++++++++++++++ .../UniversalObjectIdentifier.cs | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 mROA/Abstract/IMethodInvoker.cs create mode 100644 mROA/Implementation/MethodInvoker.cs diff --git a/mROA/Abstract/IMethodInvoker.cs b/mROA/Abstract/IMethodInvoker.cs new file mode 100644 index 0000000..35ec3b1 --- /dev/null +++ b/mROA/Abstract/IMethodInvoker.cs @@ -0,0 +1,13 @@ +using System; + +namespace mROA.Abstract +{ + public interface IMethodInvoker + { + bool IsAsync { get; } + bool IsVoid { get; } + Type[] ParameterTypes { get; } + Type? ReturnType { get; } + object? Invoke(object instance, object?[] parameters, object[] special); + } +} \ No newline at end of file diff --git a/mROA/Implementation/MethodInvoker.cs b/mROA/Implementation/MethodInvoker.cs new file mode 100644 index 0000000..b49593f --- /dev/null +++ b/mROA/Implementation/MethodInvoker.cs @@ -0,0 +1,19 @@ +using System; +using mROA.Abstract; + +namespace mROA.Implementation +{ + public class MethodInvoker : IMethodInvoker + { + public bool IsAsync { get; set; } + public bool IsVoid { get; set; } + public Type[] ParameterTypes { get; set; } = Type.EmptyTypes; + public Type? ReturnType { get; set; } + public Func Invoking { get; set; } + + public object? Invoke(object instance, object?[] parameters, object[] special) + { + return Invoking(instance, parameters, special); + } + } +} \ No newline at end of file diff --git a/mROA/Implementation/UniversalObjectIdentifier.cs b/mROA/Implementation/UniversalObjectIdentifier.cs index 0348c0f..781567e 100644 --- a/mROA/Implementation/UniversalObjectIdentifier.cs +++ b/mROA/Implementation/UniversalObjectIdentifier.cs @@ -20,7 +20,7 @@ namespace mROA.Implementation public ulong Flat { - get { return (ulong)OwnerId << 32 | (uint)ContextId; } + get => (ulong)OwnerId << 32 | (uint)ContextId; set { OwnerId = (int)(value >> 32);