/// <summary>
        ///     Build an array of shop listings offering the current item as reward.
        /// </summary>
        /// <returns>An array of shop listings offering the current item as reward.</returns>
        private IShopListing[] BuildAsShopItems()
        {
            Collections.ShopCollection shops = Sheet.Collection.Shops;

            List <IShopListing> shopItems = new List <IShopListing>();

            foreach (IShop shop in shops)
            {
                shopItems.AddRange(shop.ShopListings.Where(l => l.Rewards.Any(li => li.Item == this)));
            }
            return(shopItems.Distinct().ToArray());
        }
        /// <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());
        }
        /// <summary>
        ///     Build an array of shop listings requiring the current item as payment.
        /// </summary>
        /// <returns>An array of shop listings requiring the current item as payment.</returns>
        private IShopListingItem[] BuildAsShopPayment()
        {
            if (Key == 1)
            {
                return(new IShopListingItem[0]); // XXX: DO NOT BUILD THIS FOR GIL, THAT WOULD BE BAD.
            }
            Collections.ShopCollection shops = Sheet.Collection.Shops;

            List <IShopListing>     checkedItems  = new List <IShopListing>();
            List <IShopListingItem> shopItemCosts = new List <IShopListingItem>();

            foreach (IShopListing item in shops.SelectMany(shop => shop.ShopListings.Except(checkedItems).ToArray()))
            {
                shopItemCosts.AddRange(item.Costs.Where(_ => _.Item == this));
                checkedItems.Add(item);
            }
            return(shopItemCosts.Distinct().ToArray());
        }