public HealthService(IMapper mapper, IHeroService heroService, IResourcePouchService resourcePouchService, FarmHeroesDbContext context) { this.mapper = mapper; this.heroService = heroService; this.resourcePouchService = resourcePouchService; this.context = context; }
public ChronometerService(FarmHeroesDbContext context, IHeroService heroService, IMapper mapper, IAmuletBagService amuletBagService) { this.context = context; this.heroService = heroService; this.amuletBagService = amuletBagService; this.mapper = mapper; }
public UserService(IHttpContextAccessor httpContext, UserManager <ApplicationUser> userManager, FarmHeroesDbContext context, ITempDataDictionaryFactory tempDataDictionaryFactory) { this.httpContext = httpContext; this.userManager = userManager; this.context = context; this.tempDataDictionaryFactory = tempDataDictionaryFactory; }
public HeroController(IHeroService heroService, IUserService userService, UserManager <ApplicationUser> userManager, FarmHeroesDbContext context) { this.heroService = heroService; this.userService = userService; this.userManager = userManager; this.context = context; }
public PremiumFeaturesService( FarmHeroesDbContext context, IHeroService heroService) { this.context = context; this.heroService = heroService; }
public FightService( IHeroService heroService, IHealthService healthService, IResourcePouchService resourcePouchService, IChronometerService chronometerService, ILevelService levelService, IStatisticsService statisticsService, IMonsterService monsterService, INotificationService notificationService, IEquipmentService equipmentService, IAmuletBagService amuletBagService, FarmHeroesDbContext context, IMapper mapper) { this.heroService = heroService; this.healthService = healthService; this.resourcePouchService = resourcePouchService; this.chronometerService = chronometerService; this.levelService = levelService; this.statisticsService = statisticsService; this.monsterService = monsterService; this.notificationService = notificationService; this.equipmentService = equipmentService; this.amuletBagService = amuletBagService; this.context = context; this.mapper = mapper; }
public async Task SeedAsync(FarmHeroesDbContext dbContext, IServiceProvider serviceProvider) { if (!dbContext.ShopEquipments.Where(x => x.Type == EquipmentType.Weapon).Any()) { ShopEquipment[] shopWeapons = new ShopEquipment[] { new ShopEquipment() { Name = "Rolling-pin", Type = EquipmentType.Weapon, Price = 45, RequiredLevel = 1, Attack = 2, ImageUrl = "/images/equipment/weapons/weapon1.jpg" }, new ShopEquipment() { Name = "Ladle", Type = EquipmentType.Weapon, Price = 80, RequiredLevel = 3, Attack = 3, ImageUrl = "/images/equipment/weapons/weapon2.jpg" }, new ShopEquipment() { Name = "Enormous Handlebar", Type = EquipmentType.Weapon, Price = 150, RequiredLevel = 4, Attack = 4, ImageUrl = "/images/equipment/weapons/weapon3.jpg" }, new ShopEquipment() { Name = "Big Fork", Type = EquipmentType.Weapon, Price = 240, RequiredLevel = 5, Attack = 6, ImageUrl = "/images/equipment/weapons/weapon4.jpg" }, new ShopEquipment() { Name = "Nail Hammer", Type = EquipmentType.Weapon, Price = 470, RequiredLevel = 6, Attack = 8, ImageUrl = "/images/equipment/weapons/weapon5.jpg" }, new ShopEquipment() { Name = "Wooden Sword", Type = EquipmentType.Weapon, Price = 750, RequiredLevel = 7, Attack = 10, Mastery = 3, ImageUrl = "/images/equipment/weapons/weapon6.jpg" }, new ShopEquipment() { Name = "Farm Trident", Type = EquipmentType.Weapon, Price = 1050, RequiredLevel = 8, Attack = 10, Mastery = 6, ImageUrl = "/images/equipment/weapons/weapon7.jpg" }, new ShopEquipment() { Name = "Saber", Type = EquipmentType.Weapon, Price = 1680, RequiredLevel = 9, Attack = 15, ImageUrl = "/images/equipment/weapons/weapon8.jpg" }, new ShopEquipment() { Name = "Bat", Type = EquipmentType.Weapon, Price = 2675, RequiredLevel = 10, Attack = 21, ImageUrl = "/images/equipment/weapons/weapon9.jpg" }, new ShopEquipment() { Name = "Knife", Type = EquipmentType.Weapon, Price = 3200, RequiredLevel = 12, Attack = 10, Mastery = 21, ImageUrl = "/images/equipment/weapons/weapon10.jpg" }, new ShopEquipment() { Name = "Scythe", Type = EquipmentType.Weapon, Price = 4716, RequiredLevel = 14, Attack = 27, Mastery = 10, ImageUrl = "/images/equipment/weapons/weapon11.jpg" }, new ShopEquipment() { Name = "Sickle", Type = EquipmentType.Weapon, Price = 6666, RequiredLevel = 16, Attack = 16, Mastery = 34, ImageUrl = "/images/equipment/weapons/weapon12.jpg" }, }; await dbContext.ShopEquipments.AddRangeAsync(shopWeapons); } }
public HealthServiceTests() { this.hero = new Hero(); this.heroTwo = new Hero(); this.context = FarmHeroesDbContextInMemoryInitializer.InitializeContext(); this.healthService = this.GetHealthService(); }
public EquipmentService(IHeroService heroService, FarmHeroesDbContext context, IHttpContextAccessor httpContext, ITempDataDictionaryFactory tempDataDictionaryFactory, IMapper mapper) { this.heroService = heroService; this.context = context; this.httpContext = httpContext; this.tempDataDictionaryFactory = tempDataDictionaryFactory; this.mapper = mapper; }
public CharacteristicsService(FarmHeroesDbContext context, IMapper mapper, IHeroService heroService, IResourcePouchService resourcePouchService, IHealthService healthService) { this.context = context; this.mapper = mapper; this.heroService = heroService; this.resourcesService = resourcePouchService; this.healthService = healthService; }
public SmithService(IInventoryService inventoryService, IResourcePouchService resourcePouchService, FarmHeroesDbContext context, IHttpContextAccessor httpContext, ITempDataDictionaryFactory tempDataDictionaryFactory) { this.inventoryService = inventoryService; this.resourcePouchService = resourcePouchService; this.context = context; this.httpContext = httpContext; this.tempDataDictionaryFactory = tempDataDictionaryFactory; }
public InventoryService(IHeroService heroService, IResourcePouchService resourcePouchService, FarmHeroesDbContext context, IMapper mapper, IHttpContextAccessor httpContext, ITempDataDictionaryFactory tempDataDictionaryFactory) { this.heroService = heroService; this.resourcePouchService = resourcePouchService; this.context = context; this.mapper = mapper; this.httpContext = httpContext; this.tempDataDictionaryFactory = tempDataDictionaryFactory; }
public ChronometerServiceTests() { this.hero = new Hero(); this.heroTwo = new Hero(); this.context = FarmHeroesDbContextInMemoryInitializer.InitializeContext(); this.chronometerService = this.GetChronometerService(); }
public AmuletBagService(IHeroService heroService, IEquipmentService equipmentService, IResourcePouchService resourcePouchService, FarmHeroesDbContext context, IMapper mapper, LocalizationService localizationService) { this.heroService = heroService; this.equipmentService = equipmentService; this.resourcePouchService = resourcePouchService; this.context = context; this.mapper = mapper; this.localizationService = localizationService; }
public ShopService(FarmHeroesDbContext context, IMapper mapper, IInventoryService inventoryService, IResourcePouchService resourcePouchService, ILevelService levelService, ITempDataDictionaryFactory tempDataDictionaryFactory, IHttpContextAccessor httpContext) { this.context = context; this.mapper = mapper; this.inventoryService = inventoryService; this.resourcePouchService = resourcePouchService; this.levelService = levelService; this.tempDataDictionaryFactory = tempDataDictionaryFactory; this.httpContext = httpContext; }
public DungeonService(IResourcePouchService resourcePouchService, IHeroService heroService, IChronometerService chronometerService, IFightService fightService, INotificationService notificationService, FarmHeroesDbContext context, IMapper mapper) { this.resourcePouchService = resourcePouchService; this.heroService = heroService; this.chronometerService = chronometerService; this.fightService = fightService; this.notificationService = notificationService; this.context = context; this.mapper = mapper; }
public BattlefieldService(IHeroService heroService, IChronometerService chronometerService, ILevelService levelService, IResourcePouchService resourcePouchService, IStatisticsService statisticsService, INotificationService notificationService, FarmHeroesDbContext dbContext, IMapper mapper, IDailyLimitsService dailyLimitsService, IAmuletBagService amuletBagService) { this.heroService = heroService; this.chronometerService = chronometerService; this.levelService = levelService; this.resourcePouchService = resourcePouchService; this.statisticsService = statisticsService; this.notificationService = notificationService; this.dailyLimitsService = dailyLimitsService; this.amuletBagService = amuletBagService; this.dbContext = dbContext; this.mapper = mapper; }
public RegisterModel( UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, ILogger <RegisterModel> logger, IEmailSender emailSender, FarmHeroesDbContext context) { _userManager = userManager; _signInManager = signInManager; _logger = logger; _emailSender = emailSender; this.context = context; }
public async Task SeedAsync(FarmHeroesDbContext dbContext, IServiceProvider serviceProvider) { if (dbContext.Monsters.Any()) { return; } Monster[] monsters = new Monster[] { new Monster() { Name = "Zombie Miner", AvatarUrl = "/images/monsters/zombie-miner.jpg", Level = 1, StatPercentage = 50, MinimalRewardModifier = 10, MaximalRewardModifier = 100 }, new Monster() { Name = "Scarecrow", AvatarUrl = "/images/monsters/scarecrow.jpg", Level = 2, StatPercentage = 55, MinimalRewardModifier = 10, MaximalRewardModifier = 110 }, new Monster() { Name = "Fiery Chicken", AvatarUrl = "/images/monsters/fiery-chicken.jpg", Level = 3, StatPercentage = 70, MinimalRewardModifier = 15, MaximalRewardModifier = 110 }, new Monster() { Name = "Green Slime", AvatarUrl = "/images/monsters/green-slime.jpg", Level = 4, StatPercentage = 80, MinimalRewardModifier = 20, MaximalRewardModifier = 130 }, new Monster() { Name = "Hypnotizing Cat", AvatarUrl = "/images/monsters/hypnotizing-cat.jpg", Level = 5, StatPercentage = 90, MinimalRewardModifier = 50, MaximalRewardModifier = 250 }, new Monster() { Name = "Madshroom", AvatarUrl = "/images/monsters/madshroom.jpg", Level = 6, StatPercentage = 100, MinimalRewardModifier = 100, MaximalRewardModifier = 550 }, new Monster() { Name = "Panda-Assassin", AvatarUrl = "/images/monsters/panda-assassin.jpg", Level = 7, StatPercentage = 110, MinimalRewardModifier = 250, MaximalRewardModifier = 750 }, new Monster() { Name = "Squeen", AvatarUrl = "/images/monsters/squeen.jpg", Level = 8, StatPercentage = 125, MinimalRewardModifier = 500, MaximalRewardModifier = 5000 }, new Monster() { Name = "Zirkus Firus", AvatarUrl = "/images/monsters/zirkus-firus.jpg", Level = 9, StatPercentage = 150, MinimalRewardModifier = 500, MaximalRewardModifier = 20000 }, }; await dbContext.Monsters.AddRangeAsync(monsters); }
public HarbourService( IResourcePouchService resourcePouchService, IChronometerService chronometerService, INotificationService notificationService, IPremiumFeaturesService premiumFeaturesService, IHeroService heroService, FarmHeroesDbContext context) { this.resourcePouchService = resourcePouchService; this.chronometerService = chronometerService; this.notificationService = notificationService; this.premiumFeaturesService = premiumFeaturesService; this.heroService = heroService; this.context = context; }
public LevelServiceTests() { this.hero = new Hero() { Level = new Level() { CurrentLevel = 5, CurrentExperience = 0, NeededExperience = 33, }, }; this.heroTwo = new Hero(); this.context = FarmHeroesDbContextInMemoryInitializer.InitializeContext(); this.levelService = this.GetLevelService(); }
public async Task SeedAsync(FarmHeroesDbContext dbContext, IServiceProvider serviceProvider) { if (dbContext.ShopBonuses.Any()) { return; } ShopBonus[] bonuses = new ShopBonus[] { new ShopBonus() { Name = "Gold Safe", Description = "In case of a loss, the enemy will only steal half of what he would do usually.", InitialBonus = 0.5, CrystalsPrice = 250, ImageUrl = "/images/village/hut/gold-safe.jpg", AttainableFrom = "Hut", Days = 14, IsPermanent = false, Type = BonusType.Other }, new ShopBonus() { Name = "Gold Totem", Description = "Increases your characteristics by 30% during fights.", InitialBonus = 0.3, CrystalsPrice = 350, ImageUrl = "/images/village/hut/gold-totem.jpg", AttainableFrom = "Hut", Days = 14, IsPermanent = false, Type = BonusType.Characteristics }, }; await dbContext.ShopBonuses.AddRangeAsync(bonuses); }
public async Task SeedAsync(FarmHeroesDbContext dbContext, IServiceProvider serviceProvider) { if (dbContext.DatabaseLevels.Any()) { return; } List <DatabaseLevel> levels = new List <DatabaseLevel>(); int neededExperience = 20; for (int i = 1; i <= 100; i++) { levels.Add(new DatabaseLevel() { Level = i, NeededExperience = neededExperience, }); neededExperience = (int)(neededExperience * Modifier); } await dbContext.DatabaseLevels.AddRangeAsync(levels); }
public async Task SeedAsync(FarmHeroesDbContext dbContext, IServiceProvider serviceProvider) { if (dbContext.ShopAmulets.Any()) { return; } ShopAmulet[] amulets = new ShopAmulet[] { new ShopAmulet() { Name = "Crystal Digger", InitialBonus = 0.5, InitialPrice = 25, ImageUrl = "/images/equipment/amulets/amulet_1.jpg" }, new ShopAmulet() { Name = "Undergrounder", InitialBonus = 0.125, InitialPrice = 50, ImageUrl = "/images/equipment/amulets/amulet_2.jpg" }, new ShopAmulet() { Name = "Criticum", InitialBonus = 0.25, InitialPrice = 10, ImageUrl = "/images/equipment/amulets/amulet_3.jpg" }, new ShopAmulet() { Name = "Fatty", InitialBonus = 0.125, InitialPrice = 15, ImageUrl = "/images/equipment/amulets/amulet_4.jpg" }, new ShopAmulet() { Name = "Laborium", InitialBonus = 2.5, InitialPrice = 30, ImageUrl = "/images/equipment/amulets/amulet_5.jpg" }, new ShopAmulet() { Name = "Speedster", InitialBonus = 0.5, InitialPrice = 5, ImageUrl = "/images/equipment/amulets/amulet_6.jpg" }, }; await dbContext.ShopAmulets.AddRangeAsync(amulets); }
public async Task SeedAsync(FarmHeroesDbContext dbContext, IServiceProvider serviceProvider) { if (dbContext == null) { throw new ArgumentNullException(nameof(dbContext)); } if (serviceProvider == null) { throw new ArgumentNullException(nameof(serviceProvider)); } var logger = serviceProvider.GetService <ILoggerFactory>().CreateLogger(typeof(ApplicationDbContextSeeder)); var seeders = new List <ISeeder> { new RolesSeeder(), new MonstersSeeder(), new HelmetsSeeder(), new WeaponsSeeder(), new ArmorSeeder(), new ShieldsSeeder(), new AmuletsSeeder(), new BonusesSeeder(), new LevelsSeeder(), }; foreach (var seeder in seeders) { await seeder.SeedAsync(dbContext, serviceProvider); await dbContext.SaveChangesAsync(); logger.LogInformation($"Seeder {seeder.GetType().Name} done."); } }
public async Task SeedAsync(FarmHeroesDbContext dbContext, IServiceProvider serviceProvider) { if (!dbContext.ShopEquipments.Where(x => x.Type == EquipmentType.Shield).Any()) { ShopEquipment[] shopShields = new ShopEquipment[] { new ShopEquipment() { Name = "Wooden Shield", Type = EquipmentType.Shield, Price = 545, RequiredLevel = 2, Defense = 5, ImageUrl = "/images/equipment/shields/shield_1.jpg" }, new ShopEquipment() { Name = "Fluffster", Type = EquipmentType.Shield, Price = 2678, RequiredLevel = 5, Attack = 3, Defense = 10, ImageUrl = "/images/equipment/shields/shield_2.jpg" }, new ShopEquipment() { Name = "Spiky", Type = EquipmentType.Shield, Price = 4512, RequiredLevel = 7, Attack = 10, Defense = 16, ImageUrl = "/images/equipment/shields/shield_3.jpg" }, new ShopEquipment() { Name = "Antique", Type = EquipmentType.Shield, Price = 12365, RequiredLevel = 13, Defense = 20, Mastery = 12, ImageUrl = "/images/equipment/shields/shield_4.jpg" }, new ShopEquipment() { Name = "Gramadan", Type = EquipmentType.Shield, Price = 34575, RequiredLevel = 18, Defense = 48, Mastery = -15, ImageUrl = "/images/equipment/shields/shield_5.jpg" }, new ShopEquipment() { Name = "Fabricco", Type = EquipmentType.Shield, Price = 78054, RequiredLevel = 22, Defense = 33, Mastery = 27, ImageUrl = "/images/equipment/shields/shield_6.jpg" }, new ShopEquipment() { Name = "Berr", Type = EquipmentType.Shield, Price = 167985, RequiredLevel = 26, Attack = 10, Defense = 44, Mastery = 8, ImageUrl = "/images/equipment/shields/shield_7.jpg" }, new ShopEquipment() { Name = "BonFish", Type = EquipmentType.Shield, Price = 338833, RequiredLevel = 30, Attack = 20, Defense = 29, Mastery = 24, ImageUrl = "/images/equipment/shields/shield_8.jpg" }, new ShopEquipment() { Name = "Spikster", Type = EquipmentType.Shield, Price = 699785, RequiredLevel = 35, Attack = 54, Defense = 32, Mastery = -20, ImageUrl = "/images/equipment/shields/shield_9.jpg" }, new ShopEquipment() { Name = "Druid", Type = EquipmentType.Shield, Price = 845788, RequiredLevel = 38, Defense = 72, Mastery = 28, ImageUrl = "/images/equipment/shields/shield_10.jpg" }, new ShopEquipment() { Name = "Smiley", Type = EquipmentType.Shield, Price = 1145789, RequiredLevel = 42, Attack = 30, Defense = 60, Mastery = 30, ImageUrl = "/images/equipment/shields/shield_11.jpg" }, new ShopEquipment() { Name = "Lunari", Type = EquipmentType.Shield, Price = 1789242, RequiredLevel = 46, Attack = 46, Defense = 42, Mastery = 50, ImageUrl = "/images/equipment/shields/shield_12.jpg" }, new ShopEquipment() { Name = "Rogn", Type = EquipmentType.Shield, Price = 2589752, RequiredLevel = 50, Attack = 88, Defense = 99, Mastery = -30, ImageUrl = "/images/equipment/shields/shield_13.jpg" }, new ShopEquipment() { Name = "X", Type = EquipmentType.Shield, Price = 2899452, RequiredLevel = 52, Attack = 22, Defense = 68, Mastery = 112, ImageUrl = "/images/equipment/shields/shield_14.jpg" }, new ShopEquipment() { Name = "Monstro", Type = EquipmentType.Shield, Price = 3386424, RequiredLevel = 54, Attack = 51, Defense = 133, Mastery = 18, ImageUrl = "/images/equipment/shields/shield_15.jpg" }, new ShopEquipment() { Name = "Cancroid", Type = EquipmentType.Shield, Price = 3755378, RequiredLevel = 57, Attack = 112, Defense = 138, ImageUrl = "/images/equipment/shields/shield_16.jpg" }, }; await dbContext.ShopEquipments.AddRangeAsync(shopShields); } }
public HeroServiceTests() { this.context = FarmHeroesDbContextInMemoryInitializer.InitializeContext(); }
public MonsterService(IHeroService heroService, FarmHeroesDbContext context, IMapper mapper) { this.heroService = heroService; this.context = context; this.mapper = mapper; }
public async Task SeedAsync(FarmHeroesDbContext dbContext, IServiceProvider serviceProvider) { if (!dbContext.ShopEquipments.Where(x => x.Type == EquipmentType.Armor).Any()) { ShopEquipment[] shopArmor = new ShopEquipment[] { new ShopEquipment() { Name = "Chafty", Type = EquipmentType.Armor, Price = 230, RequiredLevel = 2, Mastery = 3, Defense = 1, ImageUrl = "/images/equipment/armors/armor_1.jpg" }, new ShopEquipment() { Name = "Scrapster", Type = EquipmentType.Armor, Price = 846, RequiredLevel = 3, Mastery = 5, Attack = 2, ImageUrl = "/images/equipment/armors/armor_2.jpg" }, new ShopEquipment() { Name = "Cask", Type = EquipmentType.Armor, Price = 5489, RequiredLevel = 5, Defense = 10, Attack = 8, ImageUrl = "/images/equipment/armors/armor_3.jpg" }, new ShopEquipment() { Name = "Holley", Type = EquipmentType.Armor, Price = 8426, RequiredLevel = 7, Defense = 10, Mastery = 15, ImageUrl = "/images/equipment/armors/armor_4.jpg" }, new ShopEquipment() { Name = "Metzo", Type = EquipmentType.Armor, Price = 10875, RequiredLevel = 9, Attack = 15, Mastery = 15, ImageUrl = "/images/equipment/armors/armor_5.jpg" }, new ShopEquipment() { Name = "Modern Cask", Type = EquipmentType.Armor, Price = 14752, RequiredLevel = 11, Attack = 15, Mastery = 15, Defense = 15, ImageUrl = "/images/equipment/armors/armor_6.jpg" }, new ShopEquipment() { Name = "Rivvr", Type = EquipmentType.Armor, Price = 21589, RequiredLevel = 13, Defense = 48, ImageUrl = "/images/equipment/armors/armor_7.jpg" }, new ShopEquipment() { Name = "Abster", Type = EquipmentType.Armor, Price = 28555, RequiredLevel = 15, Attack = 43, ImageUrl = "/images/equipment/armors/armor_9.jpg" }, new ShopEquipment() { Name = "Crimа", Type = EquipmentType.Armor, Price = 49872, RequiredLevel = 20, Defense = 47, Attack = 11, Mastery = 38, ImageUrl = "/images/equipment/armors/armor_10.jpg" }, new ShopEquipment() { Name = "V", Type = EquipmentType.Armor, Price = 62357, RequiredLevel = 24, Defense = 57, Mastery = 74, ImageUrl = "/images/equipment/armors/armor_11.jpg" }, new ShopEquipment() { Name = "Angelo", Type = EquipmentType.Armor, Price = 83675, RequiredLevel = 27, Attack = 60, Defense = 120, ImageUrl = "/images/equipment/armors/armor_12.jpg" }, new ShopEquipment() { Name = "Sunn", Type = EquipmentType.Armor, Price = 109306, RequiredLevel = 29, Mastery = 168, ImageUrl = "/images/equipment/armors/armor_13.jpg" }, new ShopEquipment() { Name = "OM-88", Type = EquipmentType.Armor, Price = 148388, RequiredLevel = 31, Attack = 138, Defense = 33, ImageUrl = "/images/equipment/armors/armor_14.jpg" }, new ShopEquipment() { Name = "Saharum", Type = EquipmentType.Armor, Price = 178462, RequiredLevel = 34, Attack = 120, Defense = 60, Mastery = 30, ImageUrl = "/images/equipment/armors/armor_15.jpg" }, new ShopEquipment() { Name = "Skelto", Type = EquipmentType.Armor, Price = 217850, RequiredLevel = 36, Attack = 155, Defense = 155, ImageUrl = "/images/equipment/armors/armor_16.jpg" }, new ShopEquipment() { Name = "Aquavoz", Type = EquipmentType.Armor, Price = 258762, RequiredLevel = 38, Attack = 33, Defense = 57, Mastery = 194, ImageUrl = "/images/equipment/armors/armor_17.jpg" }, }; await dbContext.ShopEquipments.AddRangeAsync(shopArmor); } }
public LevelService(FarmHeroesDbContext context, IHeroService heroService, INotificationService notificationService) { this.context = context; this.heroService = heroService; this.notificationService = notificationService; }