Esempio n. 1
0
        public IEnumerable <SightseeingLogTask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <SightseeingLogTask>();
            var ctr   = id;
            var parse = ParseResource <SightseeingLogParse>(resource);

            tasks.AddRange(parse.Select((x, index) =>
            {
                var task = new SightseeingLogTask
                {
                    Id         = ++ctr,
                    Name       = x.Name,
                    Number     = x.Number,
                    Weather    = x.Weather,
                    Time       = x.Time,
                    Emote      = x.Emote,
                    CategoryId = seedling.CategoryId,
                    PatchId    = SeedCommon.GetMajorPatchId(x.Set)
                };

                return(task);
            }));

            id = ctr;

            return(tasks);
        }
Esempio n. 2
0
        public IEnumerable <ClassQuestTask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <ClassQuestTask>();
            var ctr   = id;
            var parse = ParseResource <ClassQuestParse>(resource);

            tasks.AddRange(parse.Select((x, index) =>
            {
                return(new ClassQuestTask
                {
                    Id = ++ctr,
                    Name = x.Name,
                    CategoryId = SeedCategories
                                 .GetCategoryId(
                        ((ClassQuestSeedling)seedling).ParentCategory, x.Discipline
                        ),
                    Level = int.Parse(x.Level),
                    DisciplineId = SeedCommon.GetDisciplineId(x.Discipline)
                });
            }));

            id = ctr;

            return(tasks);
        }
Esempio n. 3
0
        public static AchievementReward[] SeedAchievementRewards(AchievementTask[] tasks)
        {
            var rewards = new List <AchievementReward>();
            var id      = 0;

            foreach (var task in tasks)
            {
                var split = SplitReward(task.Reward);

                for (int i = 0; i < split.Length; i += 2)
                {
                    if (split.Length >= 2)
                    {
                        var rtype = split[i];
                        var rwd   = DelimitReward(split[i + 1]);

                        var rwds = rwd.Select(x => new AchievementReward
                        {
                            Id            = ++id,
                            AchievementId = task.Id,
                            RewardTypeId  = SeedCommon.GetRewardTypeId(rtype),
                            Reward        = x
                        });

                        rewards.AddRange(rwds);
                    }
                }
            }

            return(rewards.ToArray());
        }
Esempio n. 4
0
        public static IEnumerable <CollectionTask> ParseCollectionTasks(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <CollectionTask>();
            var ctr   = id;
            var parse = Parse <CollectionParse>(resource);

            tasks.AddRange(parse.Select((x, index) => new CollectionTask
            {
                Id               = ++ctr,
                CategoryId       = seedling.CategoryId,
                CollectionTypeId = SeedCommon.GetCollectionTypeIndex(seedling.FileName),
                Name             = x.Name,
                Method           = x.Method
            }));

            id = ctr;

            return(tasks);
        }
Esempio n. 5
0
        public IEnumerable <PvETask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <PvETask>();
            var ctr   = id;
            var parse = ParseResource <PvEParse>(resource);

            tasks.AddRange(parse.Select((x, index) =>
            {
                return(new PvETask
                {
                    Id = ++ctr,
                    Name = x.Name,
                    CategoryId = seedling.CategoryId,
                    ContentId = SeedCommon.GetContentId(x.Name)
                });
            }));

            id = ctr;

            return(tasks);
        }
Esempio n. 6
0
        public IEnumerable <FishGuideTask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <FishGuideTask>();
            var ctr   = id;
            var parse = ParseResource <FishGuideParse>(resource);

            tasks.AddRange(parse.Select((x, index) =>
            {
                return(new FishGuideTask
                {
                    Id = ++ctr,
                    CategoryId = seedling.CategoryId,
                    Name = x.Name,
                    Bait = x.Bait,
                    ILevel = x.Level,
                    ZoneId = SeedCommon.GetZoneId(x.Zone)
                });
            }));

            return(tasks);
        }
Esempio n. 7
0
        public IEnumerable <RoleQuestTask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <RoleQuestTask>();
            var ctr   = id;
            var parse = ParseResource <RoleQuestParse>(resource);

            tasks.AddRange(parse.Select((x, index) =>
            {
                return(new RoleQuestTask
                {
                    Id = ++ctr,
                    Name = x.Name,
                    CategoryId = seedling.CategoryId,
                    JobRoleId = SeedCommon.GetJobRoleId(x.Role),
                    Level = int.Parse(x.Level)
                });
            }));

            id = ctr;

            return(tasks);
        }
Esempio n. 8
0
        public IEnumerable <SQTask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <SQTask>();
            var ctr   = id;
            var parse = ParseResource <SQTaskParse>(resource);

            tasks.AddRange(parse.Select((x, index) =>
            {
                return(new SQTask
                {
                    Id = ++ctr,
                    Name = x.Name,
                    CategoryId = seedling.CategoryId,
                    Level = int.Parse(x.Level),
                    SQTypeId = SeedCommon.GetSQTypeId(((SidequestSeedling)seedling).TypeName)
                });
            }));

            id = ctr;

            return(tasks);
        }
Esempio n. 9
0
        public static BLULogTask[] SeedBLULogTasks()
        {
            var tasks = new List <BLULogTask>();
            var id    = 0;

            foreach (var seed in BLULogSeedling.Seedlings)
            {
                var resource = SeedHelper.GetBLUResource(seed.FileName);

                var parse = Parse <BLULogParse>(resource);

                tasks.AddRange(parse.Select((x, index) => new BLULogTask
                {
                    Id         = ++id,
                    CategoryId = seed.CategoryId,
                    ContentId  = SeedCommon.GetContentId(x.Content),
                    Name       = x.Name
                }));
            }

            return(tasks.ToArray());
        }
Esempio n. 10
0
        public IEnumerable <LeveTask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <LeveTask>();
            var ctr   = id;
            var parse = ParseResource <LeveParse>(resource);

            tasks.AddRange(parse.Select((x, index) =>
            {
                return(new LeveTask
                {
                    Id = ++ctr,
                    Name = x.Name,
                    CategoryId = seedling.CategoryId,
                    Level = x.Level,
                    LeveTypeId = SeedCommon.GetLeveTypeId(x.Type),
                    NPCName = x.NPC
                });
            }));

            id = ctr;

            return(tasks);
        }
Esempio n. 11
0
        public IEnumerable <MSQTask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <MSQTask>();
            var ctr   = id;
            var parse = ParseResource <MSQTaskParse>(resource);

            tasks.AddRange(parse.Select((x, index) =>
            {
                var task = new MSQTask
                {
                    Id         = ++ctr,
                    Name       = x.Name,
                    CategoryId = seedling.CategoryId,
                    MSQTypeId  = SeedCommon.GetMSQTypeId(((MSQSeedling)seedling).MSQTypeName),
                    Level      = x.Level,
                };

                return(task);
            }));

            id = ctr;

            return(tasks);
        }
Esempio n. 12
0
 public CollectionSeedling(string name, string category)
     : base(name, category)
 {
     CollectionTypeId = SeedCommon.GetCollectionTypeIndex(name);
 }
Esempio n. 13
0
 public CraftingLogSeedling(string name, string parentCategory, string childCategory)
 {
     FileName          = name;
     CategoryId        = SeedCategories.GetCategoryId(parentCategory, childCategory);
     CraftingLogTypeId = SeedCommon.GetCraftingLogTypeIndex(name);
 }
Esempio n. 14
0
 public GatheringLogSeedling(string name, string parentCategory, string childCategory, string gatherTypeName)
     : base(name, parentCategory, childCategory)
 {
     GatherTypeId = SeedCommon.GetGatherTypeId(gatherTypeName);
 }
Esempio n. 15
0
        public IEnumerable <HuntingLogTask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <HuntingLogTask>();
            var ctr   = id;
            var parse = ParseResource <HuntingLogParse>(resource);
            var mobId = 1;

            tasks.AddRange(parse.Select((x, index) =>
            {
                var task = new HuntingLogTask
                {
                    Id               = ++ctr,
                    Name             = x.Record,
                    CategoryId       = seedling.CategoryId,
                    HuntingLogTypeId = SeedCommon.GetHuntingLogTypeId(x.Record.Split(' ')[0]),
                    Level            = x.Level,
                    Number           = x.Record.Split(' ')[x.Record.Split(' ').Length - 1]
                };

                var mobNames      = x.Mobs.Split(',');
                var zoneNames     = x.Zone.Split(',');
                var locationNames = x.Location.Split(';');
                var mobs          = new List <HuntingLogMob>();

                for (var i = 0; i < mobNames.Count(); i++)
                {
                    var name         = "";
                    var zoneName     = "";
                    var location     = "";
                    var locationName = "";
                    var coordinates  = new string[] { "" };

                    try
                    {
                        name = mobNames[i].Trim();

                        zoneName = zoneNames.Length >= i + 1
                            ? zoneNames[i].Trim()
                            : zoneNames[zoneNames.Length - 1].Trim();

                        location = locationNames.Length >= i + 1
                            ? locationNames[i].Trim()
                            : locationNames[locationNames.Length - 1].Trim();

                        locationName = location.Split('(')[0].Trim();

                        coordinates = location.Split('(', ')').Length > 1
                            ? location.Split('(', ')')[1].Split(',')
                            : new string[] { "-1", "-1" };

                        mobs.Add(new HuntingLogMob
                        {
                            Id           = mobId++,
                            Name         = name,
                            Zone         = zoneName,
                            Location     = locationName,
                            X            = decimal.Parse(coordinates[0]),
                            Y            = decimal.Parse(coordinates[1]),
                            HuntingLogId = ctr
                        });
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(string.Format("Exception item: {0}", mobNames[0]));
                    }
                    //catch(FormatException ex)
                    //{
                    //    throw new Exception(string.Format("Format Exception. Name: {0}, X: {1}, Y: {2}", name, coordinates[0].Trim(), coordinates[1].Trim()));
                    //}
                    //catch(IndexOutOfRangeException ex)
                    //{
                    //    throw new Exception(string.Format("Index Out Of Range. i: {0}, NameLength: {1}, ZoneLength: {2}, LocationLength: {3}",
                    //        i, mobNames.Length, zoneNames.Length, locationNames.Length));
                    //}
                }

                task.Mobs = mobs;

                return(task);
            }));

            id = ctr;

            return(tasks);
        }
Esempio n. 16
0
        public void OnModelCreating_Common(ModelBuilder builder)
        {
            builder.Entity <AchievementType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.GetSeed <AchievementTypeEnum>());
            });

            builder.Entity <BeastRank>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.BeastRanks.SelectArray <BeastRank>());
            });

            builder.Entity <BeastTribe>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.BeastTribes.SelectArray <BeastTribe>());
            });

            builder.Entity <CollectionType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.CollectionTypes.SelectArray <CollectionType>());
            });

            builder.Entity <CraftingLogType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.CraftingLogTypes.SelectArray <CraftingLogType>());
            });

            builder.Entity <Discipline>(e =>
            {
                e.HasKey(x => x.Id);

                var data = new List <Discipline>();

                for (int i = 0; i < SeedCommon.DisciplineNames.Length; i++)
                {
                    data.Add(
                        new Discipline
                    {
                        Id           = i + 1,
                        Name         = SeedCommon.DisciplineNames[i],
                        Abbreviation = SeedCommon.DisciplineAbbrevs[i]
                    }
                        );
                }

                e.HasData(data.ToArray());
            });

            builder.Entity <Expansion>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(
                    new Expansion {
                    Id = 1, Name = "A Realm Reborn"
                },
                    new Expansion {
                    Id = 2, Name = "Heavensward"
                },
                    new Expansion {
                    Id = 3, Name = "Stormblood"
                },
                    new Expansion {
                    Id = 4, Name = "Shadowbringers"
                }
                    );
            });

            builder.Entity <FATEType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.FATETypes.SelectArray <FATEType>());
            });

            builder.Entity <GatherType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.GatherTypes);
            });

            builder.Entity <HuntingLogType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.HuntingLogTypes.SelectArray <HuntingLogType>());
            });

            builder.Entity <JobRole>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(
                    SeedCommon.JobRoles.SelectArray <JobRole>()
                    );
            });

            builder.Entity <LeveType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(
                    SeedCommon.LeveTypes
                    );
            });

            builder.Entity <MSQType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.MSQTypes.SelectArray <MSQType>());
            });

            builder.Entity <OrchestrionType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.OrchestrionTypes.SelectArray <OrchestrionType>());
            });

            builder.Entity <Patch>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.Patches);
            });

            builder.Entity <PvEContentType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.ContentTypes.ToArray());
            });

            builder.Entity <PvEContent>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.GetPvEContent().ToArray());
            });

            builder.Entity <Region>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.Regions.ToArray());
            });

            builder.Entity <RewardType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.RewardTypes);
            });

            builder.Entity <SQType>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.SQTypes.SelectArray <SQType>());
            });

            builder.Entity <Zone>(e =>
            {
                e.HasKey(x => x.Id);

                e.HasData(SeedCommon.GetZones().ToArray());
            });
        }
Esempio n. 17
0
 public OrchestrionSeedling(string name)
     : base(name, "Collections", "Orchestrion")
 {
     OrchestrionTypeId = SeedCommon.GetOrchestrionTypeId(name);
 }
Esempio n. 18
0
        public IEnumerable <RelicWeaponTask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks  = new List <RelicWeaponTask>();
            var ctr    = id;
            var sdling = ((RelicWeaponSeedling)seedling);

            switch (sdling.Category.ToLower())
            {
            case "zodiac":
                var zParse = ParseResource <ZodiacWeaponParse>(resource);

                foreach (var z in zParse)
                {
                    tasks.AddRange(
                        CreateRelicWeaponTasks(
                            ref ctr,
                            seedling.CategoryId,
                            SeedCommon.GetDisciplineIdByAbbreviation(z.Discipline),
                            z.FirstName,
                            z.SecondName
                            )
                        );
                }
                break;

            case "anima":
                var aParse = ParseResource <AnimaWeaponParse>(resource);

                foreach (var a in aParse)
                {
                    tasks.AddRange(
                        CreateRelicWeaponTasks(
                            ref ctr,
                            seedling.CategoryId,
                            SeedCommon.GetDisciplineIdByAbbreviation(a.Discipline),
                            a.FirstName,
                            a.SecondName,
                            a.ThirdName,
                            a.FourthName
                            )
                        );
                }
                break;

            case "eurekan":
                var eParse = ParseResource <EurekanWeaponParse>(resource);

                foreach (var e in eParse)
                {
                    tasks.AddRange(
                        CreateRelicWeaponTasks(
                            ref ctr,
                            seedling.CategoryId,
                            SeedCommon.GetDisciplineIdByAbbreviation(e.Discipline),
                            e.AnemosName,
                            string.Concat("Elemental ", e.ElementalPyrosName),
                            e.PhyseosName
                            )
                        );
                }
                break;

            default:
                break;
            }

            id = ctr;

            return(tasks);
        }
Esempio n. 19
0
 public AchievementSeedling(string name, string category, string type)
 {
     FileName          = name;
     CategoryId        = SeedCategories.GetCategoryId(category);
     AchievementTypeId = SeedCommon.GetAchievementTypeId(type);
 }