Example #1
0
 public DifficultyLevelChooser(IInputReader reader,
                               GameMessageWriter writer,
                               LevelChecker levelChecker)
 {
     this._reader       = reader;
     this._writer       = writer;
     this._levelChecker = levelChecker;
 }
Example #2
0
 public GamePlayer(IInputReader reader,
                   GameMessageWriter writer,
                   RandomNumberSelector randomNumberSelector,
                   UserNameRetriever userNameRetriever,
                   DifficultyLevelChooser difficultyLevelChooser)
 {
     this._reader = reader;
     this._writer = writer;
     this._randomNumberSelector   = randomNumberSelector;
     this._userNameRetriever      = userNameRetriever;
     this._difficultyLevelChooser = difficultyLevelChooser;
 }
Example #3
0
        public GamePlayer createGamePlayer()
        {
            IInputReader           reader                 = new UserInputReader();
            NameChecker            nameChecker            = new NameChecker();
            LevelChecker           levelChecker           = new LevelChecker();
            ResponseWriter         responseWriter         = new ResponseWriter();
            GameMessageWriter      writer                 = new GameMessageWriter(responseWriter);
            DifficultyLevelChooser difficultyLevelChooser = new DifficultyLevelChooser(reader, writer, levelChecker);
            RandomNumberSelector   randomNumberSelector   = new RandomNumberSelector();
            UserNameRetriever      userNameRetriever      = new UserNameRetriever(reader, writer, nameChecker);
            GamePlayer             gamePlayer             = new GamePlayer(reader,
                                                                           writer,
                                                                           randomNumberSelector,
                                                                           userNameRetriever,
                                                                           difficultyLevelChooser);

            return(gamePlayer);
        }