// in the below, 'string' is changed to 'CommandWords' as needed static void Main(string[] args) { while (true) { string s = GetInputFromConsole(); CommandWords w = ExtractCommandFromString(s); ActionCommand(w); } }
public bool ShouldExecute(string commandText) => _isEnabled && CommandWords.Any(x => x.EqualsIns(commandText));
private static void ActionCommand(CommandWords w) => commands[w]();
public Parser(CommandWords newCommands) { commands = newCommands; }
public HelpCommand(CommandWords commands) : base() { words = commands; this.name = "help"; }