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]; CommandInterpreter commandInterpreter = new CommandInterpreter(repository, unitFactory); var result = commandInterpreter.InterpretCommand(data, commandName); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine(e.Message); } } }
public Engine(CommandInterpreter interpreter, Dependencies dependencies) { this.interpreter = interpreter; this.dependencies = dependencies; }
public Engine() { this.commandInterpreter = new CommandInterpreter(); }
public Engine(CommandInterpreter interpreter) { this.interpreter = interpreter; }
public Engine(IRepository repository, IUnitFactory unitFactory) { this.repository = repository; this.unitFactory = unitFactory; this.commandInterpreter = new CommandInterpreter(unitFactory, repository); }
public Engine(CommandInterpreter commandInterpreter) { this.commandInterpreter = commandInterpreter; }
public Engine(IRepository repository, IUnitFactory unitFactory) { this.interpreter = new CommandInterpreter(repository, unitFactory); }