mirror of
https://github.com/NexusForever/NexusForever
synced 2026-08-14 00:26:05 -04:00
26 lines
697 B
C#
26 lines
697 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
|
|
namespace NexusForever.WorldServer.Command
|
|
{
|
|
public class MethodContainer
|
|
{
|
|
public object Parent { get; }
|
|
public MethodInfo Method { get; }
|
|
|
|
/// <summary>
|
|
/// Create a new <see cref="MethodContainer"/> from the supplied parent object and <see cref="MethodInfo"/>.
|
|
/// </summary>
|
|
public MethodContainer(object parent, MethodInfo method)
|
|
{
|
|
Parent = parent;
|
|
Method = method;
|
|
}
|
|
|
|
public void Invoke(IEnumerable<object> parameters)
|
|
{
|
|
Method.Invoke(Parent, parameters.ToArray());
|
|
}
|
|
}
|
|
}
|