private void Execute(ParsedInput parsedInput) { switch (parsedInput.command) { //run relevant execute depending on the the command case "subject": Console.WriteLine($"Command output: { commands[(int)ICommandIndexes.SubjectIndex].Execute(parsedInput.parameters, state)}"); break; case "to": Console.WriteLine($"Command output: {commands[(int)ICommandIndexes.ToIndex].Execute(parsedInput.parameters, state)}"); break; case "body": Console.WriteLine($"Command output: {commands[(int)ICommandIndexes.BodyIndex].Execute(parsedInput.parameters, state)}"); break; case "send": Console.WriteLine($"Command output: {commands[(int)ICommandIndexes.SendIndex].Execute(parsedInput.parameters, state)}"); break; } }
private ParsedInput ParseCommand(string text) { ParsedInput parsedInput = new ParsedInput(text); return(parsedInput); }