Table of Contents

Class CommandDefinition

Namespace
SampSharp.Entities.SAMP.Commands
Assembly
SampSharp.OpenMp.Entities.Commands.dll

Represents a single overload of a command (one specific method implementation). Multiple overloads can exist for the same command with different parameter types.

public class CommandDefinition
Inheritance
CommandDefinition
Inherited Members

Constructors

CommandDefinition(string, CommandGroup?, MethodInfo, ParameterInfo[], Type, CommandParameterInfo[], CommandInvoker, int, CommandAlias[], CommandTag[], CommandComponentMatcher)

Initializes a new instance.

public CommandDefinition(string name, CommandGroup? group, MethodInfo method, ParameterInfo[] parameters, Type declaringSystemType, CommandParameterInfo[] parsedParameters, CommandInvoker invoker, int prefixParameterCount, CommandAlias[] aliases, CommandTag[] tags, CommandComponentMatcher componentMatcher)

Parameters

name string
group CommandGroup?
method MethodInfo
parameters ParameterInfo[]
declaringSystemType Type
parsedParameters CommandParameterInfo[]
invoker CommandInvoker
prefixParameterCount int
aliases CommandAlias[]
tags CommandTag[]
componentMatcher CommandComponentMatcher

Properties

Aliases

Aliases for this overload.

public IReadOnlyList<CommandAlias> Aliases { get; }

Property Value

IReadOnlyList<CommandAlias>

CompiledComponentMatcher

Gets the matcher used to evaluate command components.

public CommandComponentMatcher CompiledComponentMatcher { get; }

Property Value

CommandComponentMatcher

CompiledInvoker

Gets the invoker used to execute the associated command efficiently.

public CommandInvoker CompiledInvoker { get; }

Property Value

CommandInvoker

DeclaringSystemType

The type of the ISystem that declares this command.

public Type DeclaringSystemType { get; }

Property Value

Type

FullName

The full command path (group + name), e.g., "admin money give".

public string FullName { get; }

Property Value

string

Group

The command group, if any (e.g., ["admin", "money"]).

public CommandGroup? Group { get; }

Property Value

CommandGroup?

Method

The method that implements this command overload.

public MethodInfo Method { get; }

Property Value

MethodInfo

MethodParameters

All parameters of the method (including prefix and DI).

public ParameterInfo[] MethodParameters { get; }

Property Value

ParameterInfo[]

Name

The command name (without leading slash or group prefix).

public string Name { get; }

Property Value

string

ParsedParameters

Parameters that are parsed from command input (excludes prefix and DI parameters). These are in the order they appear in the method signature.

public CommandParameterInfo[] ParsedParameters { get; }

Property Value

CommandParameterInfo[]

PrefixParameterCount

The number of prefix parameters (e.g., Player for player commands, ConsoleCommandSender for console commands).

public int PrefixParameterCount { get; }

Property Value

int

Tags

Custom metadata tags attached to this overload.

public IReadOnlyDictionary<string, string> Tags { get; }

Property Value

IReadOnlyDictionary<string, string>