Ejemplo n.º 1
0
        /// <summary>
        ///     Build the array of <see cref="GCScripShopItem" />s offered by this shop.
        /// </summary>
        /// <remarks>
        ///     This method takes all <see cref="GCScripShopItem" />s with keys from <see cref="Min" /> to
        ///     <see cref="Max" /> (inclusive).
        /// </remarks>
        /// <returns>An array of <see cref="GCScripShopItem" />s offered by this shop.</returns>
        private GCScripShopItem[] BuildItems()
        {
            List <GCScripShopItem> items = new List <GCScripShopItem>();

            Dictionary <int, GCScripShopCategory> gcShopCategoryKeys = Sheet.Collection.GetSheet <GCScripShopCategory>()
                                                                       .Where(c => c.GrandCompany.Key == this.GrandCompany.Key)
                                                                       .ToDictionary(c => c.Key);

            XivSheet2 <GCScripShopItem> gcItems = Sheet.Collection.GetSheet2 <GCScripShopItem>();

            foreach (GCScripShopItem gcItem in gcItems)
            {
                if (gcItem.Item.Key != 0 && gcShopCategoryKeys.ContainsKey(gcItem.ParentKey))
                {
                    items.Add(gcItem);
                }
            }

            return(items.ToArray());
        }
 public Enumerator(XivSheet2 <T> sheet)
 {
     _Sheet = sheet;
     _SourceParentEnumerator = sheet._Source.GetEnumerator();
 }