public void Destroy() { if (DisplayedInventory != null) { DisplayedInventory.Clear(); } }
private void removeAllHiddenItemsFromDisplayedInventory() { for (int i = 0; i < HiddenItems.Count; i++) { DisplayedInventory.Remove(HiddenItems[i]); } }
public void SetDisplayedInventoryToHidden() { DisplayedInventory = HiddenItems; if (DisplayedInventory.Count > 0) { DisplayedInventory.Sort(compareInventoryIdByCreationDate); } InventoryContext.EventBus.DispatchEvent(new InventoryModelEvents.DisplayedInventoryUpdated(DisplayedInventory.Count)); }
public void SetDisplayedInventoryToEquipped() { if (InventoryData.CurrentAvatarEquipment.Count > 0) { DisplayedInventory = InventoryData.CurrentAvatarEquipment; DisplayedInventory.Sort(compareInventoryIdByCreationDate); } InventoryContext.EventBus.DispatchEvent(new InventoryModelEvents.DisplayedInventoryUpdated(DisplayedInventory.Count)); }
public void DeleteEquipment(long id) { if (InventoryData.CurrentAvatarEquipment.Contains(id)) { RequestRemoveEquipment(id); new SaveOutfitToWearCMD(InventoryData.CurrentAvatarEquipment.ToArray(), GetCurrentAvatarEquipment()).Execute(); } if (DisplayedInventory.Contains(id)) { DisplayedInventory.Remove(id); } InventoryData.Inventory.Remove(id); memberInventory.Remove(id); nonmemberInventory.Remove(id); }
public void SetDisplayedInventoryToAll(bool ignoreHiddenItems) { if (InventoryData.Inventory.Count > 0) { List <long> list = new List <long>(); list.AddRange(nonmemberInventory); list.AddRange(memberInventory); DisplayedInventory = list; if (ignoreHiddenItems) { removeAllHiddenItemsFromDisplayedInventory(); } DisplayedInventory.Sort(compareInventoryIdByCreationDate); } InventoryContext.EventBus.DispatchEvent(new InventoryModelEvents.DisplayedInventoryUpdated(DisplayedInventory.Count)); }