public ReactionTeam(List <Blade> first, List <Blade> second, List <Blade> third, List <ComboOrder> finishableElements) { First = first; Second = second; Third = third; FinishableElements = finishableElements; var allBlades = new List <Blade>(first); allBlades.AddRange(second); allBlades.AddRange(third); // we dont care for these //ReactionMap.Add(Reaction.Knockback, 0); //ReactionMap.Add(Reaction.Blowdown, 0); ReactionMap.Add(Reaction.Break, 0); ReactionMap.Add(Reaction.Launch, 0); ReactionMap.Add(Reaction.Smash, 0); ReactionMap.Add(Reaction.Topple, 0); foreach (var blade in allBlades) { foreach (var reaction in blade.Reactions) { // we dont care for these if (reaction == Reaction.Blowdown || reaction == Reaction.Knockback) { continue; } ReactionMap[reaction]++; } } }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } ReactionMap = await DbContext.ReactionMaps.FindAsync(id); if (ReactionMap != null) { DbContext.ReactionMaps.Remove(ReactionMap); await DbContext.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } ReactionMap = await DbContext.ReactionMaps .AsQueryable() .FirstOrDefaultAsync(m => m.Id == id); if (ReactionMap == null) { return(NotFound()); } return(Page()); }