public GameController(
     IGameRepository repository,
     INameGenerator nameGenerator,
     IGameBoardGenerator gameBoardGenerator,
     IRandomAccessor randomAccessor,
     IGameUpdater gameUpdater)
 {
     _repository         = repository ?? throw new ArgumentNullException(nameof(repository));
     _nameGenerator      = nameGenerator ?? throw new ArgumentNullException(nameof(nameGenerator));
     _gameBoardGenerator = gameBoardGenerator ?? throw new ArgumentNullException(nameof(gameBoardGenerator));
     _randomAccessor     = randomAccessor ?? throw new ArgumentNullException(nameof(randomAccessor));
     _gameUpdater        = gameUpdater ?? throw new ArgumentNullException(nameof(gameUpdater));
 }
Esempio n. 2
0
 public GameUpdater(
     IGameRepository repository,
     INameGenerator nameGenerator,
     IGameBoardGenerator gameBoardGenerator,
     IRandomAccessor randomAccessor,
     IHubContext <GameHub, IGameClient> gameContext,
     IOptions <BotSettings> botSettings)
 {
     _repository         = repository ?? throw new ArgumentNullException(nameof(repository));
     _nameGenerator      = nameGenerator ?? throw new ArgumentNullException(nameof(nameGenerator));
     _gameBoardGenerator = gameBoardGenerator ?? throw new ArgumentNullException(nameof(gameBoardGenerator));
     _randomAccessor     = randomAccessor ?? throw new ArgumentNullException(nameof(randomAccessor));
     _gameContext        = gameContext ?? throw new ArgumentNullException(nameof(gameContext));
     _botDelay           = botSettings.Value.BotDelay;
 }
Esempio n. 3
0
        DynamicCsvRow ICsvParser.this[int index]
        {
            get
            {
                if (_randomAccessor == null || _randomAccessor.NextLineNo != index)
                {
                    _randomAccessor = RandomAccessor.New(_path, index);
                }

                _randomAccessor.MoveNext();
                var row = CsvRow.New(_columns, _randomAccessor.Current);

                return
                    (new DynamicCsvRow(row));
            }
        }
Esempio n. 4
0
 public BoardGenerator(IRandomAccessor randomAccessor)
 {
     _rand = randomAccessor;
 }
 public NameGenerator(IRandomAccessor rand)
 {
     _rand = rand ?? throw new ArgumentNullException(nameof(rand));
 }