示例#1
0
        public void AddSynchroCommandsToSoulbreak(Soulbreak soulbreak)
        {
            var Synchros = soulbreakRepository.GetSynchrosByCharacterAndSoulbreak(soulbreak.Info.Character, soulbreak.Info.Name);

            soulbreak.SynchroCommands = new List <SynchroCommand>();

            foreach (var synchro in Synchros)
            {
                var newSynchro = new SynchroCommand();

                newSynchro.Info = synchro;

                newSynchro.SynchroStatuses = statusRepository.GetStatusesByEffectText(synchro.Name, synchro.Effects);
                FilterAttachElementFromStatuses(newSynchro.SynchroStatuses);

                newSynchro.SynchroOthers = new Dictionary <string, List <SheetOthers> >();

                foreach (var status in newSynchro.SynchroStatuses.SelectMany(x => x.Value))
                {
                    statusRepository.GetOthersByNamesAndSource(status.Name, newSynchro.SynchroOthers);
                }

                foreach (var other in newSynchro.SynchroOthers)
                {
                    foreach (var otherStatus in other.Value)
                    {
                        FilterAttachElementFromStatuses(otherStatus.OtherStatuses);
                    }
                }

                soulbreak.SynchroCommands.Add(newSynchro);
            }
        }
示例#2
0
        public IEnumerable <SynchroCommand> GetSynchroCommandsBySearch(SynchroCommand searchPrototype)
        {
            //ignore: CharacterName, Description, SourceSoulBreakName, ImagePath, EnlirId, Id, ImagePath, IsChecked, IsCounterable, JapaneseName, SoulBreakPointsGainedJapan
            var query = _enlirRepository.GetMergeResultsContainer().SynchroCommands;

            if (searchPrototype.CharacterId != 0)
            {
                query = query.Where(c => c.CharacterId == searchPrototype.CharacterId);
            }
            if (searchPrototype.AbilityType != 0)
            {
                query = query.Where(c => c.AbilityType == searchPrototype.AbilityType);
            }
            if (searchPrototype.School != 0)
            {
                query = query.Where(c => c.School == searchPrototype.School);
            }
            if (searchPrototype.Elements != null && searchPrototype.Elements.Any())
            {
                query = query.Where(c => c.Elements.Contains(searchPrototype.Elements.First()));
            }
            if (!string.IsNullOrWhiteSpace(searchPrototype.CommandName))
            {
                query = query.Where(c => c.CommandName.Contains(searchPrototype.CommandName));
            }
            if (searchPrototype.AutoTargetType != 0)
            {
                query = query.Where(c => c.AutoTargetType == searchPrototype.AutoTargetType);
            }
            if (searchPrototype.CastTime != 0)
            {
                query = query.Where(c => c.CastTime <= searchPrototype.CastTime);
            }
            if (searchPrototype.DamageFormulaType != 0)
            {
                query = query.Where(c => c.DamageFormulaType == searchPrototype.DamageFormulaType);
            }
            if (searchPrototype.Multiplier != 0)
            {
                query = query.Where(c => c.Multiplier >= searchPrototype.Multiplier);
            }
            if (searchPrototype.SoulBreakPointsGained != 0)
            {
                query = query.Where(c => c.SoulBreakPointsGained >= searchPrototype.SoulBreakPointsGained);
            }
            if (searchPrototype.TargetType != 0)
            {
                query = query.Where(c => c.TargetType == searchPrototype.TargetType);
            }

            return(query);
        }