/// <summary> /// See <see cref="DebugConsole.AddCommand"/> /// </summary> /// <param name="command">Command.</param> /// <param name="description">Description.</param> /// <param name="action">Action.</param> public static void AddCommand(string command, string description, DebugConsoleAction.Action action) { if (Console != null) { Console.AddCommand(command, description, action); } }
/// <summary> /// Adds a command to be used in the console. /// </summary> /// <param name="command">The command template that should be used. /// eg. "print (text)" or "add (number) (number)".</param> /// <param name="description">Description.</param> /// <param name="action">Action.</param> public void AddCommand(string command, string description, DebugConsoleAction.Action action) { string PrettyDescription = command; foreach (string Line in description.Split('\n')) { PrettyDescription += "\n " + Line; } Actions[command] = new DebugConsoleAction(PrettyDescription, action); }