The Remove() methods below do not take into account "Equipment" -- that is, they do not update Stats when they are removed. If you plan on removing ItemObjects that are active in an "Equipment" list, you'll want to create your own remove methods to handle your inventory appropriately.
Remove all based on number of ItemAttributes
// If GameItemObject, ItemObject, or itemObjectUid is provided, only those of// that ItemObject will be removed// Remove all with exact number of attributespublicvoidRemoveAllWithExactlyXAttributes(int amount,ItemObject itemObject)public void RemoveAllWithExactlyXAttributes(int amount,GameItemObject gameItemObject)public void RemoveAllWithExactlyXAttributes(int amount,string itemObjectUid =null)// Remove all with less than X attributespublic void RemoveAllWithLessThanXAttributes(int amount,ItemObject itemObject)public void RemoveAllWithLessThanXAttributes(int amount,GameItemObject gameItemObject)public void RemoveAllWithLessThanXAttributes(int amount,string itemObjectUid =null) // Remove all with more than X attributespublic void RemoveAllWithMoreThanXAttributes(int amount,ItemObject itemObject)public void RemoveAllWithMoreThanXAttributes(int amount,GameItemObject gameItemObject)public void RemoveAllWithMoreThanXAttributes(int amount,string itemObjectUid =null)// Remove all with no attributespublic void RemoveAllWithNoAttributes(ItemObject itemObject)public void RemoveAllWithNoAttributes(GameItemObject gameItemObject)public void RemoveAllWithNoAttributes(string itemObjectUid =null)
Remove all based on specific ItemAttributes
// If itemObjectUid is provided, only those of that ItemObject will be removed// Remove all with specific ItemAttributepublicvoidRemoveAllWithAttribute(ItemAttribute attribute,string itemObjectUid =null)public void RemoveAllWithAttribute(GameItemAttribute gameAttribute,string itemObjectUid =null)public void RemoveAllWithAttribute(string attributeUid,string itemObjectUid =null)// Remove all with ALL of the specified ItemAttributespublic void RemoveAllWithAllAttributes(IEnumerable<ItemAttribute> attributes,string itemObjectUid =null)public void RemoveAllWithAllAttributes(IEnumerable<GameItemAttribute> gameAttributes,string itemObjectUid =null)public void RemoveAllWithAllAttributes(IEnumerable<string> attributeUids,string itemObjectUid =null)// Remove all with ANY of the specified ItemAttributespublic void RemoveAllWithAnyAttributes(IEnumerable<ItemAttribute> attributes,string itemObjectUid =null)public void RemoveAllWithAnyAttributes(IEnumerable<GameItemAttribute> gameAttributes,string itemObjectUid =null)public void RemoveAllWithAnyAttributes(IEnumerable<string> attributeUids,string itemObjectUid =null)// ExampleItemAttribute[] itemAttributes = new[] { Rare, Epic, Legendary };gameItemObjectList.RemoveAllWithAnyAttributes(itemAttributes);Debug.Log("All your good loot has been removed!");
Remove duplicates
These methods will remove any duplicates. The single-object methods have an optional itemObjectUid, when null, will remove any duplicate in the entire list.
There is also an optional boolincludeItemAttributes, which is false by default. When true, a GameItemObject must match both its Uid() and its list of ItemAttributes to qualify as a duplicate.
publicvoidRemoveDuplicates(ItemObject itemObject,bool includeItemAttributes =false)public void RemoveDuplicates(GameItemObject gameItemObject,bool includeItemAttributes =false)public void RemoveDuplicates(string itemObjectUid =null,bool includeItemAttributes =false)// Only check a set of ItemObjectspublic void RemoveDuplicates(IEnumerable<ItemObject> itemObjects,bool includeItemAttributes =false)public void RemoveDuplicates(IEnumerable<GameItemObject> gameItemObjects,bool includeItemAttributes =false)public void RemoveDuplicates(IEnumerable<string> itemObjectUids,bool includeItemAttributes =false)