public void ApplyItems(IEnumerable <Item> items, StaticObject applyObject) { if (applyObject == null) { return; } var(ok, returnItem) = applyObject.OnApplyItems(items.ToArray()); foreach (var item in items) { if (item.ShouldDelete) { Inventory.Remove(item); } } if (ok) { Inventory.Add(returnItem); } }