AplosDebugCommand

The Aplos command family models a runnable console command. Commands are registered with and invoked through AplosConsole.

AplosDebugCommandBase

The base shared by every command variant. It stores the command's identity and usage text and exposes them read-only; it carries no executable delegate of its own.

Inheritance
object
 ↳ AplosDebugCommandBase


Inherited Members:

  • object.Equals(object)
  • object.Equals(object, object)
  • object.GetHashCode()
  • object.GetType()
  • object.ReferenceEquals(object, object)
  • object.ToString()

Namespace: AplosConsole.Commands

Properties

Name Data Type Description
CommandId string The identifier used to invoke the command from the console. Read-only.
CommandDescription string Human-readable description shown in the command list and help output. Read-only.
CommandFormat string Usage/format string describing the command's expected arguments. Read-only.

Constructors

AplosDebugCommandBase

Parameters:

  • commandId (string) — Identifier used to invoke the command.
  • commandDescription (string) — Description shown in the command list.
  • commandFormat (string) — Usage/format string for the command.

Example

public class MyCommand : AplosDebugCommandBase
{
    public MyCommand(string id, string description, string format)
        : base(id, description, format) { }
}

Description: Initialises the shared metadata. Normally called via base(...) from a derived AplosDebugCommand variant rather than directly.


AplosDebugCommand

A parameterless command. Wraps an Action that runs when the command is invoked with no arguments.

Inheritance
object
 ↳ AplosDebugCommandBase
    ↳ AplosDebugCommand


Inherited Members:

  • AplosDebugCommandBase.CommandId
  • AplosDebugCommandBase.CommandDescription
  • AplosDebugCommandBase.CommandFormat

Namespace: AplosConsole.Commands

Properties

Name Data Type Description
IsBuiltIn bool Marks the command as one that ships with the console (as opposed to a user-registered command). Defaults to false. Get/set.

Constructors

AplosDebugCommand

Parameters:

  • commandId (string) — Identifier used to invoke the command.
  • commandDescription (string) — Description shown in the command list.
  • commandFormat (string) — Usage/format string for the command.
  • command (Action) — Action to run when the command is invoked.
  • isBuiltIn (bool) — Whether to flag the command as a built-in command. Defaults to false.

Example

var command = new AplosDebugCommand("hello", "Prints a greeting", "hello", () => Debug.Log("Hi!"));

Description: Builds a parameterless command from the given metadata and action. Pass isBuiltIn: true to flag it as a built-in command.


Public methods

Invoke

Example

command.Invoke();

Description: Executes the wrapped action. No-op if the action is null.


AplosDebugCommand<T>

A single-argument command. Wraps an Action<T> invoked with one typed argument parsed from the console input.

Inheritance
object
 ↳ AplosDebugCommandBase
    ↳ AplosDebugCommand<T>


Inherited Members:

  • AplosDebugCommandBase.CommandId
  • AplosDebugCommandBase.CommandDescription
  • AplosDebugCommandBase.CommandFormat

Namespace: AplosConsole.Commands

Constructors

AplosDebugCommand

Parameters:

  • commandId (string) — Identifier used to invoke the command.
  • commandDescription (string) — Description shown in the command list.
  • commandFormat (string) — Usage/format string for the command.
  • command (Action<T>) — Action to run when the command is invoked, receiving the parsed argument.

Example

var command = new AplosDebugCommand<int>("setlevel", "Sets the level", "setlevel <int>", level => Debug.Log(level));

Description: Builds a command from the given metadata that forwards a single typed argument to command.


Public methods

Invoke

Parameters:

  • value (T) — The argument to forward to the wrapped action.

Example

command.Invoke(5);

Description: Executes the wrapped action with the supplied argument. No-op if the action is null.


AplosDebugCommand<T1, T2>

A two-argument command. Wraps an Action<T1, T2> invoked with two typed arguments parsed from the console input.

Inheritance
object
 ↳ AplosDebugCommandBase
    ↳ AplosDebugCommand<T1, T2>


Inherited Members:

  • AplosDebugCommandBase.CommandId
  • AplosDebugCommandBase.CommandDescription
  • AplosDebugCommandBase.CommandFormat

Namespace: AplosConsole.Commands

Constructors

AplosDebugCommand

Parameters:

  • commandId (string) — Identifier used to invoke the command.
  • commandDescription (string) — Description shown in the command list.
  • commandFormat (string) — Usage/format string for the command.
  • command (Action<T1, T2>) — Action to run when the command is invoked, receiving the two parsed arguments.

Example

var command = new AplosDebugCommand<int, string>("setitem", "Sets an item", "setitem <int> <string>", (id, name) => Debug.Log($"{id}: {name}"));

Description: Builds a command from the given metadata that forwards two typed arguments to command.


Public methods

Invoke

Parameters:

  • value (T1) — The first argument to forward to the wrapped action.
  • value2 (T2) — The second argument to forward to the wrapped action.

Example

command.Invoke(5, "sword");

Description: Executes the wrapped action with the two supplied arguments. No-op if the action is null.