コード例 #1
0
        private string InterpredCommand(string[] data, string commandName)
        {
            CommandInterpreter interpreter = new CommandInterpreter(unitFactory, repository);
            IExecutable        command     = interpreter.InterpretCommand(data, commandName);

            return(command.Execute());
        }
コード例 #2
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);
         }
     }
 }
コード例 #3
0
ファイル: Engine.cs プロジェクト: Sleyy/Csharp-Professional
 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);
         }
     }
 }
コード例 #4
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);
         }
     }
 }
コード例 #5
0
        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);
                }
            }
        }