Table of Contents

Struct CommandGroup

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

Represents a hierarchical command group (e.g., ["admin", "money", "give"]). Command groups provide a namespace for commands.

public readonly struct CommandGroup : IEquatable<CommandGroup>
Implements
Inherited Members

Constructors

CommandGroup(IEnumerable<string>)

Initializes a new instance from a collection of group parts.

public CommandGroup(IEnumerable<string> parts)

Parameters

parts IEnumerable<string>

CommandGroup(params string[])

Initializes a new instance from an ordered sequence of group parts.

public CommandGroup(params string[] parts)

Parameters

parts string[]

Properties

Depth

The number of parts in this command group.

public int Depth { get; }

Property Value

int

FullName

The full command group as a space-separated string (e.g., "admin money").

public string FullName { get; }

Property Value

string

Parts

The ordered parts of this command group (e.g., ["admin", "money"]).

public IReadOnlyList<string> Parts { get; }

Property Value

IReadOnlyList<string>

Methods

Equals(CommandGroup)

public bool Equals(CommandGroup other)

Parameters

other CommandGroup

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

GetParent(int)

Gets a subgroup with the first N parts (e.g., depth 1 of ["admin", "money"] = ["admin"]).

public CommandGroup GetParent(int depth)

Parameters

depth int

Returns

CommandGroup

Stack(CommandGroup)

Stacks this group with another, returning a new group with combined parts.

public CommandGroup Stack(CommandGroup other)

Parameters

other CommandGroup

Returns

CommandGroup

Stack(string)

Stacks this group with a single part.

public CommandGroup Stack(string part)

Parameters

part string

Returns

CommandGroup

ToString()

public override string ToString()

Returns

string

Operators

operator ==(CommandGroup, CommandGroup)

Determines whether two command groups are equal.

public static bool operator ==(CommandGroup left, CommandGroup right)

Parameters

left CommandGroup

The first command group to compare.

right CommandGroup

The second command group to compare.

Returns

bool

True if the command groups are equal; otherwise, false.

operator !=(CommandGroup, CommandGroup)

Determines whether two command groups are not equal.

public static bool operator !=(CommandGroup left, CommandGroup right)

Parameters

left CommandGroup

The first command group to compare.

right CommandGroup

The second command group to compare.

Returns

bool

True if the command groups are not equal; otherwise, false.