Creates a new instance with the specified name.
The command name that is used to invoke the command. Only alpha-numeric without spaces.
The description of the command.
The delegate that will be invoked upon command execution.
OptionalisInternalConstructor: booleanThe newly allocated ConsoleCommand.
A ConsoleCommand is a special type of (global) variable that represents a command that can be executed through the engine's console.
To declare a ConsoleCommand in C++ code, you can do the following:
The ConsoleCommand will be thread-safe registered upon creation of the respective instance and automatically thread-safe unregistered when the instance is deallocated. This makes the ConsoleCommand suitable for use in both the global scope of the application, and locally within a class, to expose functionality while the class is alive.
The execution thread depends is equal to the source of the execution. The number of arguments depend on the execution string. It's best to not assert on expectionations, but provide runtime help to the user if the argument contents or size do not match the requirements of the ConsoleCommand.
In the above example, the first parameter is the command name. It is a case-insensitive unique identifier that is used to set invoke the command through the application-wide console. If a command with same name is already registered, the registration will be declined and an error is reported. Note that the name comparision is done case-insensitive.
The second parameter is a command description. This string is used to explain to the user what the command is, what it's purpose is and the arguments. The description will be printed when the enters
help <name>or if the only argument passed to the command execute ishelp.The third parameter is the delegate that will be invoked when the user executes the command.