private IGameOfLife _createSubjectUnderTest(int rows, int cols, IGameEventEmitter eventEmitter = null, IGenerationService genService = null) { eventEmitter = eventEmitter ?? new GameEventEmitterBuilder().Build(); genService = genService ?? new GenerationServiceBuilder().Build(); return(new GameOfLife(eventEmitter, genService, rowCount: rows, columnCount: cols)); }
public ConsoleRunner( [NotNull] IGenerationService generationService, [NotNull] IConsoleWriter consoleWriter, [NotNull] IHelpWriter helpWriter, [NotNull] IResultWriter resultWriter) { if (generationService == null) { throw new ArgumentNullException(nameof(generationService)); } if (consoleWriter == null) { throw new ArgumentNullException(nameof(consoleWriter)); } if (resultWriter == null) { throw new ArgumentNullException(nameof(resultWriter)); } if (helpWriter == null) { throw new ArgumentNullException(nameof(helpWriter)); } _generationService = generationService; _consoleWriter = consoleWriter; _helpWriter = helpWriter; _resultWriter = resultWriter; }
public GameOfLife(IGameEventEmitter eventEmitter, IGenerationService genService, int rowCount, int columnCount) { _eventEmitter = eventEmitter; _genService = genService; this.RowCount = rowCount; this.ColCount = columnCount; }
public TransactionService(IBanksCardRepository banksCardRepository, IUserService userService, IBankAccountRepository bankAccountRepository, ICurrencyService currencyService, IGenerationService generationService, ITransactionBankRepository transactionBankRepository) { _banksCardRepository = banksCardRepository; _userService = userService; _bankAccountRepository = bankAccountRepository; _currencyService = currencyService; _generationService = generationService; _transactionBankRepository = transactionBankRepository; }
public async Task <List <DTO.DropdownPokemon> > GetPokemonsByGenerationId(int id, [FromServices] IGenerationService service, [FromServices] IMemoryCache cache) { var pokemons = cache.Get <List <DTO.DropdownPokemon> >($"GetPokemonsByGenerationId{id}"); if (pokemons != null) { return(pokemons); } pokemons = await service.GetPokemonsByGeneration(id); cache.Set($"GetPokemonsByGenerationId{id}", pokemons); return(pokemons); }
public AccountPresentation(IBankAccountRepository bankAccountRepository, IMapper mapper, IWebHostEnvironment hostEnvironment, UserService userService, IGenerationService generationService, ICurrencyService currencyService, ITransactionService transactionService) { _bankAccountRepository = bankAccountRepository; _mapper = mapper; _hostEnvironment = hostEnvironment; _userService = userService; _generationService = generationService; _currencyService = currencyService; _transactionService = transactionService; }
public double CalcOwnedUpgrades(Upgrade up) { if (up.UpgradeType == UpgradeType.Profit) { IGenerationService generationService = GameServices.Instance.GenerationService; if (generationService.Generators.Contains(up.GeneratorIdToUpgrade)) { return(generationService.Generators.GetGeneratorInfo(up.GeneratorIdToUpgrade).ProfitBoosts.Value); //GetProfitValue(up.GeneratorIdToUpgrade); } } if (up.UpgradeType == UpgradeType.Time) { if (GameServices.Instance.GenerationService.Generators.Contains(up.GeneratorIdToUpgrade)) { return(GameServices.Instance.GenerationService.Generators.GetGeneratorInfo(up.GeneratorIdToUpgrade).TimeBoosts.Value); //GetTimeValue(up.GeneratorIdToUpgrade); } } return(0); }
public async Task <Models.Generation> Get(int id, [FromServices] IGenerationService service) { return(await service.Get(id)); }
public async Task <List <DTO.Generation> > GetAll([FromServices] IGenerationService service) { return(await service.GetAll()); }
public GameFactory(IGenerationService genService) { _genService = genService; }
public GenerationController(IGenerationService generationService) { _generationService = generationService; }