private string InterpredCommand(string[] data, string commandName) { CommandInterpreter interpreter = new CommandInterpreter(unitFactory, repository); IExecutable command = interpreter.InterpretCommand(data, commandName); return(command.Execute()); }
public void Run() { while (true) { try { string input = Console.ReadLine(); string[] data = input.Split(); CommandInterpreter cmdInterpreter = new CommandInterpreter(this.repository, this.unitFactory); IExecutable currentCommand = cmdInterpreter.InterpretCommand(data, data[0]); Console.WriteLine(currentCommand.Execute()); } catch (Exception e) { Console.WriteLine(e.Message); } } }
public void Run() { while (true) { try { string input = Console.ReadLine(); string[] data = input.Split(); string commandName = data[0]; IExecutable command = interpreter.InterpretCommand(data, commandName); string result = command.Execute(); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine(e.Message); } } }
public void Run() { while (true) { try { string input = Console.ReadLine(); string[] data = input.Split(); string commandName = data[0]; CommandInterpreter commandInterpreter = new CommandInterpreter(repository, unitFactory); var result = commandInterpreter.InterpretCommand(data, commandName); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine(e.Message); } } }
public void Run() { while (true) { try { var input = Console.ReadLine(); var data = input.Split(); var commandName = data[0]; var instance = interpreter.InterpretCommand(data, commandName); var result = instance.Execute(); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine(e.Message); } } }