示例#1
0
        /// <summary>
        ///     Build an array of sources from which to obtain the current item.
        /// </summary>
        /// <returns>An array of sources from which to obtain the current item.</returns>
        private IItemSource[] BuildSources()
        {
            List <IItemSource> sources = new List <IItemSource>();

            Libra.Item libraRow = null;
            if (Sheet.Collection.IsLibraAvailable)
            {
                libraRow = Sheet.Collection.Libra.Items.FirstOrDefault(i => i.Key == this.Key);
            }

            IXivSheet <Recipe>      recipes      = Sheet.Collection.GetSheet <Recipe>();
            IXivSheet <Quest>       quests       = Sheet.Collection.GetSheet <Quest>();
            IXivSheet <Achievement> achievements = Sheet.Collection.GetSheet <Achievement>();

            Collections.ShopCollection       shops         = Sheet.Collection.Shops;
            IXivSheet <Leve>                 leves         = Sheet.Collection.GetSheet <Leve>();
            IXivSheet <FishingSpot>          fishingSpots  = Sheet.Collection.GetSheet <FishingSpot>();
            IXivSheet <RetainerTask>         retainerTasks = Sheet.Collection.GetSheet <RetainerTask>();
            IXivSheet <CompanyCraftSequence> companyCraft  = Sheet.Collection.GetSheet <CompanyCraftSequence>();

            if (libraRow != null)
            {
                Collections.BNpcCollection  bnpcColl         = Sheet.Collection.BNpcs;
                IXivSheet <InstanceContent> instanceContents = Sheet.Collection.GetSheet <InstanceContent>();

                foreach (long bnpc in libraRow.BNpcs)
                {
                    sources.Add(bnpcColl[bnpc]);
                }
                foreach (int ic in libraRow.InstanceContents)
                {
                    sources.Add(instanceContents[ic]);
                }
            }

            /*sources.AddRange(bnpcColl.Where(i => i.Items.Contains(this)));
             * sources.AddRange(instanceContents.Cast<IItemSource>().Where(i => i.Items.Contains(this)));*/

            // Not using Libra for these because it has a higher likelyhood of being incomplete.
            sources.AddRange(recipes.Where(i => i.ResultItem == this));
            sources.AddRange(quests.Cast <IItemSource>().Where(i => i.Items.Contains(this)));
            sources.AddRange(achievements.Where(i => i.Item == this));
            sources.AddRange(shops.Where(i => i.Items.Contains(this)));

            // Not using Libra for this because it doesn't even have information about it
            sources.AddRange(leves.Where(i => i.Items.Contains(this)));
            sources.AddRange(fishingSpots.Where(i => i.Items.Contains(this)));
            sources.AddRange(retainerTasks.Where(i => i.Items.Contains(this)));
            sources.AddRange(companyCraft.Where(i => i.ResultItem == this));

            return(sources.ToArray());
        }
示例#2
0
        /// <summary>
        ///     Build an array of sources from which to obtain the current item.
        /// </summary>
        /// <returns>An array of sources from which to obtain the current item.</returns>
        private IItemSource[] BuildSources()
        {
            var sources = new List <IItemSource>();

            Libra.Item libraRow = null;

            var recipes       = Sheet.Collection.GetSheet <Recipe>();
            var quests        = Sheet.Collection.GetSheet <Quest>();
            var achievements  = Sheet.Collection.GetSheet <Achievement>();
            var shops         = Sheet.Collection.Shops;
            var leves         = Sheet.Collection.GetSheet <Leve>();
            var fishingSpots  = Sheet.Collection.GetSheet <FishingSpot>();
            var retainerTasks = Sheet.Collection.GetSheet <RetainerTask>();
            var companyCraft  = Sheet.Collection.GetSheet <CompanyCraftSequence>();

            if (libraRow != null)
            {
                var bnpcColl         = Sheet.Collection.BNpcs;
                var instanceContents = Sheet.Collection.GetSheet <InstanceContent>();
            }

            /*sources.AddRange(bnpcColl.Where(i => i.Items.Contains(this)));
             * sources.AddRange(instanceContents.Cast<IItemSource>().Where(i => i.Items.Contains(this)));*/

            // Not using Libra for these because it has a higher likelyhood of being incomplete.
            sources.AddRange(recipes.Where(i => i.ResultItem == this));
            sources.AddRange(quests.Cast <IItemSource>().Where(i => i.Items.Contains(this)));
            sources.AddRange(achievements.Where(i => i.Item == this));
            sources.AddRange(shops.Where(i => i.Items.Contains(this)));

            // Not using Libra for this because it doesn't even have information about it
            sources.AddRange(leves.Where(i => i.Items.Contains(this)));
            sources.AddRange(fishingSpots.Where(i => i.Items.Contains(this)));
            sources.AddRange(retainerTasks.Where(i => i.Items.Contains(this)));
            sources.AddRange(companyCraft.Where(i => i.ResultItem == this));

            return(sources.ToArray());
        }