mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-14 04:55:43 +00:00
38 lines
935 B
C#
38 lines
935 B
C#
using System.Collections.ObjectModel;
|
|
using System.Reflection;
|
|
|
|
namespace VpSharp.Commands;
|
|
|
|
/// <summary>
|
|
/// Represents a registered command.
|
|
/// </summary>
|
|
public sealed class Command
|
|
{
|
|
internal Command(string name, string[] aliases, MethodInfo method, CommandModule module)
|
|
{
|
|
Name = name;
|
|
Aliases = new ReadOnlyCollection<string>(aliases);
|
|
Method = method;
|
|
Module = module;
|
|
Parameters = method.GetParameters()[1..];
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the aliases for this command.
|
|
/// </summary>
|
|
/// <value>The aliases.</value>
|
|
public IReadOnlyList<string> Aliases { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the name of this command.
|
|
/// </summary>
|
|
/// <value>The name.</value>
|
|
public string Name { get; }
|
|
|
|
internal MethodInfo Method { get; }
|
|
|
|
internal CommandModule Module { get; }
|
|
|
|
internal ParameterInfo[] Parameters { get; }
|
|
}
|