void AddIIAndMutate(IUIItem item, int idAtAdd) { IItemIcon newItemIcon = thisPickupSystemUIElementFactory.CreateItemIcon(item); List <IItemIcon> newIIs = CreateNewItemIconsFrom(thisItemIcons); newIIs.Insert(idAtAdd, newItemIcon); this.UpdateIIs(newIIs); IReformation reformation = new Reformation(iconGroup: this, newProspectiveIIs: thisItemIcons, travelTransferII: newItemIcon, iisToInit: null); UpdateMutation(reformation, travelTransferData: null); }
public void RemoveIIAndMutate(IItemIcon itemIconToRemove) { if (thisItemIcons.Contains(itemIconToRemove)) { List <IItemIcon> newIIs = CreateNewItemIconsFrom(thisItemIcons); newIIs.Remove(itemIconToRemove); this.UpdateIIs(newIIs); IReformation reformation = new Reformation(iconGroup: this, newProspectiveIIs: newIIs, travelTransferII: null, iisToInit: null); UpdateMutation(reformation, travelTransferData: null); } else { throw new System.InvalidOperationException("itemIconToRemove is not a memeber of thisItemIcons"); } }