public virtual Command GetAssistingCommand(Command.PriorityType priority, string text) { foreach (Command cmd in Commands) { if ((cmd.Priority & priority) == priority && cmd.IsOwner(text)) { return(cmd); } } return(null); }
private InterpreterPlugin GetAssistingPlugin(string cmd, string parameters, Command.PriorityType priority) { if (parameters.Trim() == string.Empty) { return(null); } else { foreach (InterpreterPlugin plugin in _plugins) { Command command = plugin.GetCommandByName(cmd); if (command != null && command.FitsPriority(priority) && command.IsOwner(parameters)) { return(plugin); } } return(null); } }
public virtual string GetAssistingCommandName(Command.PriorityType priority, string text) { return(GetAssistingCommand(priority, text).Name); }