コード例 #1
0
        public GadgetSlot(EGadgetSlot inSlot, int inCapacity)
        {
            Slot     = inSlot;
            Capacity = inCapacity;

            Gadgets = new List <IGadgetInterface>(Capacity);
        }
コード例 #2
0
        // ~IGadgetSetInterface

        private bool HasSlotSpace(EGadgetSlot inSlotId)
        {
            // Need to have a capacity to carry
            if (_slotCapacities.ContainsKey(inSlotId) && _slotCapacities[inSlotId] > 0)
            {
                // No slot would mean it's empty (remove slots on empty)
                if (_gadgetSlots.Exists((value) => value.Slot == inSlotId))
                {
                    var slot = _gadgetSlots.Find((value) => value.Slot == inSlotId);
                    return(slot.Gadgets.Count < slot.Capacity);
                }

                return(true);
            }

            return(false);
        }