private List <Peg> TryToProcessInput()
        {
            var processedInput = new List <Peg>();

            try
            {
                _display.Display(ClientConstants.GuessesLeft + _game.RemainingTurns + ClientConstants.PromptGuess);

                var input = _collector.Collect();

                processedInput = _processor.Process(input);

                _collectingInputIsComplete = true;
            }
            catch (Exception e)
            {
                _display.DisplayError(e.Message);
            }

            return(processedInput);
        }
Example #2
0
        private List <Block> GetTalks()
        {
            var processedTalks = new List <Block>();

            while (!processedTalks.Any())
            {
                _display.Display(Constants.FilePathPrompt);

                var input = _inputCollector.Collect();

                if (UserIsQuittingApplication(input))
                {
                    _quit = true;  // TODO: Command Query separation?
                    break;
                }

                var talks = _inputProvider.ProvideInput(input);

                processedTalks = _inputProcessor.Process(talks);
            }

            return(processedTalks);
        }