public ExtractHeroAssetsScript(FehContextFactory dbContextFactory, string sourceDirectory, string targetDirectory, bool overwrite = false) { this._dbContext = dbContextFactory.CreateDbContext(); this._sourceDirectory = sourceDirectory; this._targetDirectory = targetDirectory; this._overwrite = overwrite; }
public WeaponService(FehContext context, IMapper mapper) { _mapper = mapper; _weaponRepository = new WeaponRepository(context); _weaponUpgradeRepository = new WeaponUpgradeRepository(context); _weaponTypeRepository = new WeaponTypeRepository(context); _weaponCostRepository = new BaseRepository <WeaponCost>(context); _WeaponEffectiveAgainstRepository = new BaseRepository <WeaponEffectiveAgainst>(context); _weaponStatChangeRepository = new BaseRepository <WeaponStatChange>(context); }
public ImportHeroesScript(FehContextFactory dbContextFactory, string sourceFile) { this._dbContext = dbContextFactory.CreateDbContext(); this._sourceFiile = sourceFile; this._artistMap = this._dbContext .Artists .ToDictionaryAsync( x => x.Name.ToLower(), y => y ) .Result; }
public ImportHeroSkillsScript(FehContextFactory dbContextFactory, string sourceFile) { this._dbContext = dbContextFactory.CreateDbContext(); this._sourceFiile = sourceFile; this._heroMap = this._dbContext .Heroes .ToDictionaryAsync( x => x.Tag, y => y ) .Result; this._skillMap = this._dbContext .Skills .ToDictionaryAsync( x => x.Tag, y => y ) .Result; }
public SkillWeaponEffectivenessService(FehContext dbContext) { this._dbContext = dbContext; }
public HeroVoiceActorService(FehContext dbContext) { this._dbContext = dbContext; }
public WeaponUpgradeRepository(FehContext context) : base(context) { }
public ItemService(FehContext dbContext) { this._dbContext = dbContext; }
public HeroSkillService(FehContext dbContext) { this._dbContext = dbContext; }
public ImportVoiceActorsScript(FehContextFactory dbContextFactory, string sourceFile) { this._dbContext = dbContextFactory.CreateDbContext(); this._sourceFiile = sourceFile; }
public static async Task Initialize(FehContext context, IWeaponService weaponService, IAuthService authService, IConfiguration configuration) { context.Database.EnsureCreated(); if (!context.WeaponTypes.Any()) { try { var weaponTypes = JsonConvert.DeserializeObject <List <WeaponType> >(File.ReadAllText("Seed" + Path.DirectorySeparatorChar + GetFileName("WeaponType"))); foreach (var wt in weaponTypes) { context.WeaponTypes.Add(wt); } context.SaveChanges(); } catch (Exception e) { throw e; } } if (!context.MovementTypes.Any()) { try { var movementTypes = JsonConvert.DeserializeObject <List <MovementType> >(File.ReadAllText("Seed" + Path.DirectorySeparatorChar + GetFileName("MovementType"))); foreach (var mt in movementTypes) { context.MovementTypes.Add(mt); } context.SaveChanges(); } catch (Exception e) { throw e; } } if (!context.Weapons.Any()) { try { var weapons = JsonConvert.DeserializeObject <List <WeaponResource> >(File.ReadAllText("Seed" + Path.DirectorySeparatorChar + GetFileName("Weapons"))); var refinedWeapons = JsonConvert.DeserializeObject <List <WeaponResource> >(File.ReadAllText("Seed" + Path.DirectorySeparatorChar + GetFileName("WeaponsRefined"))); // gets images for refined weapons (since they have the same image as the unrefined versions) for (int i = 0; i < refinedWeapons.Count(); i++) { if (string.IsNullOrEmpty(refinedWeapons[i].ImageUri)) { var split = refinedWeapons[i].Name.Split('(')[0]; var fixedLength = split.Substring(0, split.Length - 1); var weaponWhere = weapons.Where(w => w.Name.Contains(fixedLength)); refinedWeapons[i].ImageUri = weaponWhere.First().ImageUri; } } await weaponService.CreateFromList(weapons); await weaponService.CreateFromList(refinedWeapons); } catch (Exception e) { throw e; } } if (!context.Users.Any()) { try { UserResource userEntry = new UserResource() { Username = "******", Password = "******" }; await authService.CreateAccount(userEntry); } catch (Exception e) { throw e; } } }
public BaseRepository(FehContext context) { _context = context; _entities = context.Set <T>(); }
public UserRepository(FehContext context) : base(context) { }
public AuthService(FehContext context, IConfiguration Configuration) { _userRepository = new UserRepository(context); _configuration = Configuration; }
public SkillWeaponTypeService(FehContext dbContext) { this._dbContext = dbContext; }
public ArtistService(FehContext dbContext) { this._dbContext = dbContext; }
public MovementTypeRepository(FehContext context) : base(context) { }
public SkillMovementTypeService(FehContext dbContext) { this._dbContext = dbContext; }
public WeaponTypeRepository(FehContext context) : base(context) { }
public AccessoryService(FehContext dbContext) { this._dbContext = dbContext; }