public void AddObserver(string name, string signature, string helpText, ExecConsoleCmd callback) { _observers.Add(new CmdConsoleObserver { name = name, signature = signature, helpText = helpText, callback = callback }); }
public void AddCommand(string name, string signature, string helpText, ExecConsoleCmd callback) { if (_observers.Any(x => x.name == name)) { throw new ArgumentException($"Command name {name} already taken!"); } _observers.Add(new CmdConsoleObserver { name = name, signature = signature, helpText = helpText, callback = callback }); }