Class: MultiKeyMap

MultiKeyMap()

new MultiKeyMap()

Source:

Methods

_AddItem()

Source:
Returns:
true if the items list changed in such a way that cached values are possibly invalidated.

_getItems()

Source:
Returns:
a list of items. This does not necessarily return a reference to items' list, use _getItemsOrInit for that.

_getItemsOrInit()

Source:
Returns:
a reference to the list of items for that property name and secondaryKey.

_OnItemModified()

Stub method, to overload.
Source:

_RemoveItem()

Source:
Returns:
true if the items list changed in such a way that cached values are possibly invalidated.

AddItem(item, itemID, stackable)

Add a single item. NB: if you add an item with a different value but the same itemID, the original value remains.
Parameters:
Name Type Description
item an object.
itemID internal ID of this item, for later removal and/or updating
stackable if stackable, changing the count of items invalides, otherwise not.
Source:
Returns:
true if the items list changed in such a way that cached values are possibly invalidated.

AddItems(itemID)

Add items to multiple properties at once (only one item per property)
Parameters:
Name Type Description
itemID
Source:
Returns:
true if the items list changed in such a way that cached values are possibly invalidated.

GetAllItems()

Source:
Returns:

GetItems()

Source:
Returns:
A list of items (references to stored items to avoid copying) (these need to be treated as constants to not break the map)

HasAnyItem()

Check if we have a item for any property name. Naively iterates all property names.
Source:
Returns:
true if there is at least one item with that itemID

HasItem(itemID)

Parameters:
Name Type Description
itemID internal ID of the item to try and find.
Source:
Returns:
true if there is at least one item with that itemID

RemoveAllItems()

Removes items with this ID for any property name. Naively iterates all property names.
Source:
Returns:
true if the items list changed in such a way that cached values are possibly invalidated.

RemoveItem(primaryKey, itemID, secondaryKey)

Removes a item on a property.
Parameters:
Name Type Description
primaryKey property to change (e.g. "Health/Max")
itemID internal ID of the item to remove
secondaryKey secondaryKey ID
Source:
Returns:
true if the items list changed in such a way that cached values are possibly invalidated.