public void RemoveItems(string path) { IComposite inventory = this; var names = path.Split('/'); foreach (var name in names) { inventory = inventory.GetItem(name); if (inventory == null) { return; } } inventory.Clear(); prune(path); }