예제 #1
0
 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);
         }
     }
 }
예제 #2
0
 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);
         }
     }
 }
예제 #3
0
 public Engine(CommandInterpreter interpreter, Dependencies dependencies)
 {
     this.interpreter  = interpreter;
     this.dependencies = dependencies;
 }
예제 #4
0
 public Engine()
 {
     this.commandInterpreter = new CommandInterpreter();
 }
예제 #5
0
 public Engine(CommandInterpreter interpreter)
 {
     this.interpreter = interpreter;
 }
예제 #6
0
 public Engine(IRepository repository, IUnitFactory unitFactory)
 {
     this.repository         = repository;
     this.unitFactory        = unitFactory;
     this.commandInterpreter = new CommandInterpreter(unitFactory, repository);
 }
예제 #7
0
 public Engine(CommandInterpreter commandInterpreter)
 {
     this.commandInterpreter = commandInterpreter;
 }
예제 #8
0
 public Engine(IRepository repository, IUnitFactory unitFactory)
 {
     this.interpreter = new CommandInterpreter(repository, unitFactory);
 }