Class: ConsoleCommands

(package) rune.console.ConsoleCommands()

The ConsoleCommands class represents a register of available console commands. Commands can be added and deleted via this class.

Constructor

(package) new ConsoleCommands()

Creates a new instance of the ConsoleCommands class.
Source:

Methods

add(command) → {undefined}

Adds a command to the console so that it can be called via text input.
Parameters:
Name Type Description
command rune.console.ConsoleCommand Console command to add.
Source:
Throws:
In case of incorrect data type.
Type
TypeError
Returns:
Type
undefined

create(command, callback, scope) → {undefined}

Creates and adds a new console command.
Parameters:
Name Type Description
command string The name of the command, ie. the trigger.
callback function Command function.
scope Object Scope of the function.
Source:
Returns:
Type
undefined

remove(command) → {undefined}

Removes a command.
Parameters:
Name Type Description
command string Command to remove.
Source:
Returns:
Type
undefined