Example #1
0
        private TypeListDifferences ValidateTargetTypes(ImportResultsContainer irc)
        {
            var abilityTargetTypes = irc.AbilityRows.Select(ar => ar.Target.Split(",".ToCharArray())).
                                     SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var commandTargetTypes = irc.CommandRows.Select(ar => ar.Target.Split(",".ToCharArray())).
                                     SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var otherTargetTypes = irc.OtherRows.Where(ar => !String.IsNullOrWhiteSpace(ar.Type)).Select(ar => ar.Target.Split(",".ToCharArray())).
                                   SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var soulBreakTargetTypes = irc.SoulBreakRows.Select(ar => ar.Target.Split(",".ToCharArray())).
                                       SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var limitBreakTargetTypes = irc.LimitBreakRows.Select(ar => ar.Target.Split(",".ToCharArray())).
                                        SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            //TargetTypes - source
            var unifiedTargetTypesList = abilityTargetTypes.Union(commandTargetTypes).Union(otherTargetTypes).Union(soulBreakTargetTypes).
                                         Union(limitBreakTargetTypes).OrderBy(e => e);

            //TargetTypes - id list
            var targetTypesIdList = new TargetTypeList();
            var targetTypesIdListTargetTypeNames = targetTypesIdList.TypeList.Where(il => il.Key != 0).Select(kvp => kvp.Value).ToList();

            TypeListDifferences targetTypesDifferences = new TypeListDifferences()
            {
                IdListName = nameof(TargetTypeList),
                ValuesMissingFromIdList   = unifiedTargetTypesList.Except(targetTypesIdListTargetTypeNames).ToList(),
                ValuesSuperfluousInIdList = targetTypesIdListTargetTypeNames.Except(unifiedTargetTypesList).ToList(),
                SuggestedIdListContents   = GenerateSuggestedIdListContents(unifiedTargetTypesList)
            };

            return(targetTypesDifferences);
        }
Example #2
0
        private TypeListDifferences ValidateRealms(ImportResultsContainer irc)
        {
            var characterRealms = irc.CharacterRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
                                  SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            //var dungeonRealms = irc.DungeonRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
            //    SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var eventRealms = irc.EventRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
                              SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var legendMateriaRealms = irc.LegendMateriaRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
                                      SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var legendSphereRealms = irc.LegendSphereRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
                                     SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var magiciteRealms = irc.MagiciteRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
                                 SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var recordMateriaRealms = irc.RecordMateriaRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
                                      SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var recordSphereRealms = irc.RecordSphereRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
                                     SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var relicRealms = irc.RelicRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
                              SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var soulBreakRealms = irc.SoulBreakRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
                                  SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var limitBreakRealms = irc.LimitBreakRows.Select(ar => ar.Realm.Split(",".ToCharArray())).
                                   SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            //Realms - source
            var unifiedRealmsList = characterRealms.Union(eventRealms).
                                    Union(legendMateriaRealms).Union(legendSphereRealms).Union(magiciteRealms).
                                    Union(recordMateriaRealms).Union(recordSphereRealms).Union(relicRealms).Union(soulBreakRealms).
                                    Union(limitBreakRealms).OrderBy(e => e);

            //Realms - id list
            var realmList           = new RealmList();
            var realmListRealmNames = realmList.TypeList.Where(il => il.Key != 0).Select(kvp => kvp.Value).ToList();

            TypeListDifferences realmDifferences = new TypeListDifferences()
            {
                IdListName = nameof(RealmList),
                ValuesMissingFromIdList   = unifiedRealmsList.Except(realmListRealmNames).ToList(),
                ValuesSuperfluousInIdList = realmListRealmNames.Except(unifiedRealmsList).ToList(),
                SuggestedIdListContents   = GenerateSuggestedIdListContents(unifiedRealmsList)
            };

            return(realmDifferences);
        }
Example #3
0
        private TypeListDifferences ValidateElements(ImportResultsContainer irc)
        {
            var abilityElements = irc.AbilityRows.Select(ar => ar.Element.Split(",".ToCharArray())).
                                  SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var commandElements = irc.CommandRows.Select(ar => ar.Element.Split(",".ToCharArray())).
                                  SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var magiciteElements = irc.MagiciteRows.Select(ar => ar.Element.Split(",".ToCharArray())).
                                   SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var magiciteSkillElements = irc.MagiciteSkillRows.Where(ar => !String.IsNullOrWhiteSpace(ar.Type)).Select(ar => ar.Element.Split(",".ToCharArray())).
                                        SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var otherElements = irc.OtherRows.Where(ar => !String.IsNullOrWhiteSpace(ar.Type)).Select(ar => ar.Element.Split(",".ToCharArray())).
                                SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var soulBreakElements = irc.SoulBreakRows.Select(ar => ar.Element.Split(",".ToCharArray())).
                                    SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var limitBreakElements = irc.LimitBreakRows.Select(ar => ar.Element.Split(",".ToCharArray())).
                                     SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            //elements - source
            var unifiedElementsList = abilityElements.Union(commandElements).Union(magiciteElements).
                                      Union(magiciteSkillElements).Union(otherElements).Union(soulBreakElements).Union(limitBreakElements).OrderBy(e => e);

            //elements - id list
            var elementIdList             = new ElementList();
            var elementIdListElementNames = elementIdList.TypeList.Where(il => il.Key != 0).Select(kvp => kvp.Value).ToList();

            TypeListDifferences elementDifferences = new TypeListDifferences()
            {
                IdListName = nameof(ElementList),
                ValuesMissingFromIdList   = unifiedElementsList.Except(elementIdListElementNames).ToList(),
                ValuesSuperfluousInIdList = elementIdListElementNames.Except(unifiedElementsList).ToList(),
                SuggestedIdListContents   = GenerateSuggestedIdListContents(unifiedElementsList)
            };

            return(elementDifferences);
        }
Example #4
0
        private TypeListDifferences ValidateLimitBreakTiers(ImportResultsContainer irc)
        {
            var limitBreakSoulBreakTiers = irc.LimitBreakRows.Select(m => m.Tier.Trim()).Distinct().OrderBy(e => e).ToList();

            //SoulBreakTiers - source
            var unifiedLimitBreakTierList = limitBreakSoulBreakTiers.OrderBy(e => e);

            //SoulBreakTiers - id list
            var limitBreakTierList      = new LimitBreakTierList();
            var limitBreakTierListNames = limitBreakTierList.TypeList.Where(il => il.Key != 0).Select(kvp => kvp.Value).ToList();

            TypeListDifferences limitBreakTierDifferences = new TypeListDifferences()
            {
                IdListName = nameof(LimitBreakTierList),
                ValuesMissingFromIdList   = unifiedLimitBreakTierList.Except(limitBreakTierListNames).ToList(),
                ValuesSuperfluousInIdList = limitBreakTierListNames.Except(unifiedLimitBreakTierList).ToList(),
                SuggestedIdListContents   = GenerateSuggestedIdListContents(unifiedLimitBreakTierList)
            };

            return(limitBreakTierDifferences);
        }
Example #5
0
        private TypeListDifferences ValidateRelicTypes(ImportResultsContainer irc)
        {
            var relicRelicTypes = irc.RelicRows.Select(m => m.Type.Trim()).Distinct().OrderBy(e => e).ToList();

            //RelicTypes - source
            var unifiedRelicTypeList = relicRelicTypes.OrderBy(e => e);

            //RelicTypes - id list
            var relicTypeList      = new RelicTypeList();
            var relicTypeListNames = relicTypeList.TypeList.Where(il => il.Key != 0).Select(kvp => kvp.Value).ToList();

            TypeListDifferences relicTypeDifferences = new TypeListDifferences()
            {
                IdListName = nameof(RelicTypeList),
                ValuesMissingFromIdList   = unifiedRelicTypeList.Except(relicTypeListNames).ToList(),
                ValuesSuperfluousInIdList = relicTypeListNames.Except(unifiedRelicTypeList).ToList(),
                SuggestedIdListContents   = GenerateSuggestedIdListContents(unifiedRelicTypeList)
            };

            return(relicTypeDifferences);
        }
Example #6
0
        private TypeListDifferences ValidateEventTypes(ImportResultsContainer irc)
        {
            var eventEventTypes = irc.EventRows.Select(ar => ar.Type.Split(",".ToCharArray())).
                                  SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            //events - source
            var unifiedEventTypeList = eventEventTypes.OrderBy(e => e);

            //events - id list
            var eventTypeList           = new EventTypeList();
            var eventTypeListEventNames = eventTypeList.TypeList.Where(il => il.Key != 0).Select(kvp => kvp.Value).ToList();

            TypeListDifferences eventTypeDifferences = new TypeListDifferences()
            {
                IdListName = nameof(EventTypeList),
                ValuesMissingFromIdList   = unifiedEventTypeList.Except(eventTypeListEventNames).ToList(),
                ValuesSuperfluousInIdList = eventTypeListEventNames.Except(unifiedEventTypeList).ToList(),
                SuggestedIdListContents   = GenerateSuggestedIdListContents(unifiedEventTypeList)
            };

            return(eventTypeDifferences);
        }
Example #7
0
        private TypeListDifferences ValidateDamageFormulaTypes(ImportResultsContainer irc)
        {
            var abilityDamageFormulaTypes = irc.AbilityRows.Select(ar => ar.Formula.Split(",".ToCharArray())).
                                            SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var commandDamageFormulaTypes = irc.CommandRows.Select(ar => ar.Formula.Split(",".ToCharArray())).
                                            SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var magiciteDamageFormulaTypes = irc.MagiciteRows.Select(ar => ar.Formula.Split(",".ToCharArray())).
                                             SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var magiciteSkillDamageFormulaTypes = irc.MagiciteSkillRows.Where(ar => !String.IsNullOrWhiteSpace(ar.Type)).Select(ar => ar.Formula.Split(",".ToCharArray())).
                                                  SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var otherDamageFormulaTypes = irc.OtherRows.Where(ar => !String.IsNullOrWhiteSpace(ar.Type)).Select(ar => ar.Formula.Split(",".ToCharArray())).
                                          SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            var soulBreakDamageFormulaTypes = irc.SoulBreakRows.Select(ar => ar.Formula.Split(",".ToCharArray())).
                                              SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList();

            //DamageFormulaTypes - source
            var unifiedDamageFormulaTypesList = abilityDamageFormulaTypes.Union(commandDamageFormulaTypes).Union(magiciteDamageFormulaTypes).
                                                Union(magiciteSkillDamageFormulaTypes).Union(otherDamageFormulaTypes).Union(soulBreakDamageFormulaTypes).OrderBy(e => e);

            //DamageFormulaTypes - id list
            var damageFormulaTypesIdList = new DamageFormulaTypeList();
            var damageFormulaTypesIdListDamageFormulaTypeNames = damageFormulaTypesIdList.TypeList.Where(il => il.Key != 0).Select(kvp => kvp.Value).ToList();

            TypeListDifferences damageFormulaTypesDifferences = new TypeListDifferences()
            {
                IdListName = nameof(DamageFormulaTypeList),
                ValuesMissingFromIdList   = unifiedDamageFormulaTypesList.Except(damageFormulaTypesIdListDamageFormulaTypeNames).ToList(),
                ValuesSuperfluousInIdList = damageFormulaTypesIdListDamageFormulaTypeNames.Except(unifiedDamageFormulaTypesList).ToList(),
                SuggestedIdListContents   = GenerateSuggestedIdListContents(unifiedDamageFormulaTypesList)
            };

            return(damageFormulaTypesDifferences);
        }
Example #8
0
        private TypeListDifferences ValidateOrbTypes(ImportResultsContainer irc)
        {
            var abilityOrb1Types = irc.AbilityRows.Select(a => a.Orb1RequiredType.Trim()).Distinct().OrderBy(e => e).ToList();
            var abilityOrb2Types = irc.AbilityRows.Select(a => a.Orb2RequiredType.Trim()).Distinct().OrderBy(e => e).ToList();
            var abilityOrb3Types = irc.AbilityRows.Select(a => a.Orb3RequiredType.Trim()).Distinct().OrderBy(e => e).ToList();
            var abilityOrb4Types = irc.AbilityRows.Where(ar => !String.IsNullOrWhiteSpace(ar.Orb4RequiredType)).Select(a => a.Orb4RequiredType.Trim()).Distinct().OrderBy(e => e).ToList();

            //OrbTypes - source
            var unifiedOrbTypeList = abilityOrb1Types.Union(abilityOrb2Types).Union(abilityOrb3Types).Union(abilityOrb4Types).OrderBy(e => e);

            //OrbTypes - id list
            var orbTypeList         = new OrbTypeList();
            var orbTypeListOrbNames = orbTypeList.TypeList.Where(il => il.Key != 0).Select(kvp => kvp.Value).ToList();

            TypeListDifferences orbTypeDifferences = new TypeListDifferences()
            {
                IdListName = nameof(OrbTypeList),
                ValuesMissingFromIdList   = unifiedOrbTypeList.Except(orbTypeListOrbNames).ToList(),
                ValuesSuperfluousInIdList = orbTypeListOrbNames.Except(unifiedOrbTypeList).ToList(),
                SuggestedIdListContents   = GenerateSuggestedIdListContents(unifiedOrbTypeList)
            };

            return(orbTypeDifferences);
        }