예제 #1
0
        public void Accept(IVisitor <RewardBag> visitor)
        {
            visitor.Begin();
            foreach (var bag in this.Bags ?? Enumerable.Empty <RewardBag>())
            {
                visitor.Visit(bag);
            }

            visitor.End();
        }
예제 #2
0
        public void Accept(IVisitor <RewardBagTier> visitor)
        {
            visitor.Begin();
            foreach (var tier in this.Tiers ?? Enumerable.Empty <RewardBagTier>())
            {
                visitor.Visit(tier);
            }

            visitor.End();
        }
예제 #3
0
        public void Accept(IVisitor <Quest> visitor)
        {
            visitor.Begin();
            foreach (var quest in this.Quests ?? Enumerable.Empty <Quest>().Where(quest => quest != null))
            {
                visitor.Visit(quest);
            }

            visitor.End();
        }
예제 #4
0
        public void Accept(IVisitor <QuestSet> visitor)
        {
            visitor.Begin();
            foreach (var questSet in this.QuestSets ?? Enumerable.Empty <QuestSet>())
            {
                visitor.Visit(questSet);
            }

            visitor.End();
        }
예제 #5
0
        public void Accept(IVisitor <ItemStack> visitor)
        {
            var bagItems = from bag in this.Bags
                           from item in bag.Rewards
                           select item;

            var questIcons = from quest in this.Quests
                             where quest != null
                             select quest.Icon;

            var questRewardsCommon = from quest in this.Quests
                                     where quest != null
                                     from reward in quest.CommonRewards ?? Enumerable.Empty <ItemStack>()
                                     select reward;

            var questRewardsPickOne = from quest in this.Quests
                                      where quest != null
                                      from reward in quest.PickOneRewards ?? Enumerable.Empty <ItemStack>()
                                      select reward;

            var requirements = from quest in this.Quests
                               where quest != null
                               from task in quest.Tasks.OfType <ItemQuestTask>()
                               from requirement in task.Requirements
                               select requirement.ItemStack;

            var requirementIcons1 = from quest in this.Quests
                                    where quest != null
                                    from task in quest.Tasks.OfType <LocationQuestTask>()
                                    from requirement in task.Requirements
                                    select requirement.Icon;

            var requirementIcons2 = from quest in this.Quests
                                    where quest != null
                                    from task in quest.Tasks.OfType <MobQuestTask>()
                                    from requirement in task.Requirements
                                    select requirement.Icon;

            var allItems = Enumerable.Empty <ItemStack>()
                           .Concat(bagItems)
                           .Concat(questIcons)
                           .Concat(questRewardsCommon)
                           .Concat(questRewardsPickOne)
                           .Concat(requirements)
                           .Concat(requirementIcons1)
                           .Concat(requirementIcons2);

            visitor.Begin();
            foreach (var item in allItems.Where(item => item != null))
            {
                visitor.Visit(item);
            }

            visitor.End();
        }
예제 #6
0
        public void Accept(IVisitor <Reputation> visitor)
        {
            visitor.Begin();

            foreach (var reputation in this.Reputations ?? Enumerable.Empty <Reputation>())
            {
                visitor.Visit(reputation);
            }

            visitor.End();
        }
예제 #7
0
 public void Accept(IVisitor <QuestLine> visitor)
 {
     visitor.Begin();
     visitor.Visit(this);
     visitor.End();
 }