Add a callback function tied to the given key.
The callback function will be executed when this KeyedEventWrapper is triggered using the same key.
Key
Callback function to execute
The callback passed in, can be used with remove()
Add a callback function that will be executed any time a trigger occurs. The first argument for the callback function is the key, the rest of the arguments are what get passed to the trigger.
Callback function to execute
The callback passed in, can be used with removeAny()
Return an EventWrapper for the given key.
The EventWrapper holds all callbacks added with the same key, and is triggered when trigger is called with the same key.
Key
OptionalcreateIfMissing: booleanIf the wrapper is missing, a new one will be created.
The EventWrapper for the given key, or null if not found.
Remove a callback function tied to the given key.
Key that was used to add the callback function
Callback function to remove
Remove a callback function that was added using addAny().
Callback function to remove
Trigger all callback functions that were added using the same key.
All arguments after key will be passed to the callback functions.
Key of the events to trigger
Arguments to pass to callbacks
Simple implementation of a key-based event class.