Пример #1
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);
        }
Пример #2
0
        public IEnumerable <BeastQuestTask> Parse(Stream resource, Seedling seedling, ref int id)
        {
            var tasks = new List <BeastQuestTask>();
            var ctr   = id;
            var parse = ParseResource <BeastQuestParse>(resource);

            tasks.AddRange(parse.Select((x, index) =>
            {
                return(new BeastQuestTask
                {
                    Id = ++ctr,
                    Name = x.Name,
                    Level = int.Parse(x.Level),
                    BeastRankId = SeedCommon.BeastRanks.GetMatchId <BeastRank>(x.Rank),
                    BeastTribeId = SeedCommon.BeastTribes.GetMatchId <BeastTribe>(x.Tribe),
                    CategoryId = SeedCategories.GetCategoryId(x.Tribe)
                });
            }));

            id = ctr;

            return(tasks);
        }