mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-10 02:55:41 +00:00
Use IReadOnlyList<T> instead of T[] for public API
This commit is contained in:
parent
86458129b5
commit
99c08f33ed
@ -8,10 +8,10 @@ namespace VpSharp.Commands;
|
||||
/// </summary>
|
||||
public sealed class Command
|
||||
{
|
||||
internal Command(string name, string[] aliases, MethodInfo method, CommandModule module)
|
||||
internal Command(string name, IReadOnlyList<string> aliases, MethodInfo method, CommandModule module)
|
||||
{
|
||||
Name = name;
|
||||
Aliases = new ReadOnlyCollection<string>(aliases);
|
||||
Aliases = aliases;
|
||||
Method = method;
|
||||
Module = module;
|
||||
Parameters = method.GetParameters()[1..];
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using VpSharp.ClientExtensions;
|
||||
using VpSharp.Commands.Attributes;
|
||||
using VpSharp.EventData;
|
||||
@ -256,7 +256,7 @@ public sealed class CommandsExtension : VirtualParadiseClientExtension
|
||||
|
||||
var command = new Command(
|
||||
commandAttribute.Name,
|
||||
aliasesAttribute?.Aliases ?? Array.Empty<string>(),
|
||||
aliasesAttribute?.Aliases ?? ArraySegment<string>.Empty,
|
||||
methodInfo,
|
||||
module
|
||||
);
|
||||
|
@ -9,5 +9,5 @@ public sealed class CommandsExtensionConfiguration
|
||||
/// Gets or sets the prefixes to be use for commands.
|
||||
/// </summary>
|
||||
/// <value>The command prefixes, as an array of <see cref="string" /> values.</value>
|
||||
public string[] Prefixes { get; set; } = Array.Empty<string>();
|
||||
public IReadOnlyList<string> Prefixes { get; set; } = Array.Empty<string>();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user