Exemplo n.º 1
0
        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]++;
                }
            }
        }
Exemplo n.º 2
0
        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"));
        }
Exemplo n.º 3
0
        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());
        }