Ejemplo n.º 1
0
        public void Run()
        {
            while (true)
            {
                string input = Console.ReadLine().Trim();

                string[] commandData   = input.Split();
                string   commandName   = commandData[0];
                string[] commandTokens = commandData.Skip(1).ToArray();

                try
                {
                    ICommand command = interpreter.GetCommand(commandName);
                    command.Execute(commandTokens);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
        }