/// <summary> /// Registers a command to the console /// </summary> /// <param name="command">The command that people need to use in the console</param> /// <param name="method">The delegate method that is called when users enter the command. A string[] will be sent as argument, it will contain every word after the command.</param> /// <returns>True if successfully registered the command, otherwise fasle</returns> public static bool RegisterCommand(string command, ConsoleDebugDel method, string description = null) { if (commands.ContainsKey(command)) { return(false); } commands.Add(command, new ConsoleCommand { Method = method, Description = description }); return(true); }
public static void RegisterCommand(string command, ConsoleDebugDel method) { if (!commands.ContainsKey(command)) commands.Add(command, method); }