public int Insert(string _name, int _amount) { int _rest = _amount; InventorySlotObject _named_slot = ForceSlotByItemName(_name, _amount); if (_named_slot != null) { _rest = _named_slot.TryUpdateAmount(_name, _rest); } if (_rest > 0) { foreach (InventorySlotObject _slot in Slots) { _rest = _slot.TryUpdateAmount(_name, _rest); } } return(_rest); }