Example #1
0
        private void UpdateQuantities()
        {
            //  Initialize all quantities back to zero
            foreach (Object Placeholder in PlaceholderItems)
            {
                Placeholder.Stack = 0;
            }

            //  Set quantities of the placeholder items to match the corresponding amount of the item currently stored in the bag
            foreach (Object Item in Bag.Contents)
            {
                Object Placeholder = PlaceholderItems.FirstOrDefault(x => ItemBag.AreItemsEquivalent(x, Item, false, true));
                if (Placeholder != null)
                {
                    ItemBag.ForceSetQuantity(Placeholder, Item.Stack);
                }
            }
        }
        private PlaceholderStateItem GetPlaceholderTemplate(PlaceholderState placeholderState)
        {
            var template = PlaceholderItems.Where(a => a.StateItemKey == placeholderState).FirstOrDefault();

            return(template);
        }