示例#1
0
        public virtual bool Craft(ItemStorage materialStorage, ItemStorage destinationStorage)
        {
            if (CanBeCrafted(materialStorage) && destinationStorage.GetFreeSpace() >= Quantity)
            {
                destinationStorage.Add(Result, Quantity);
                foreach (var c in Costs)
                {
                    materialStorage.Remove(c.Item, c.Count);
                }

                return(true);
            }

            return(false);
        }
示例#2
0
        public virtual bool Craft(ItemStorage i)
        {
            if (CanBeCrafted(i) && i.GetFreeSpace() >= Quantity)
            {
                i.Add(Result, Quantity);
                foreach (var c in Costs)
                {
                    i.Remove(c.Item, c.Count);
                }

                return(true);
            }

            return(false);
        }