CompoundOperationMap
A sequence of operations run against one map. It does as little as possible: no locking, just a note of whether the map was changed, so the map underneath knows when to hand work off.
Upstream also has a locking variant for thread-safe objects. This port has none (D-3).
Functions
Link copied to clipboard
Puts a slot straight in. Both its name and its index hash have to be set already. ScriptableObject normally goes through modify instead.
Link copied to clipboard
open override fun <S : Slot> compute(owner: SlotMapOwner, key: Any?, index: Int, compute: SlotMap.SlotComputer<S>): S?
Replaces what key maps to with whatever compute returns: null removes the mapping, and anything else replaces or creates it. If compute throws, nothing changes.
open override fun <S : Slot> compute(owner: SlotMapOwner?, mutableMap: CompoundOperationMap, key: Any?, index: Int, compute: SlotMap.SlotComputer<S>): S?
Link copied to clipboard
Opens a compound operation over this map.