-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
featureSuggests or adds a new featureSuggests or adds a new feature
Milestone
Description
Feature
Delegates on listeners allow for single self-destroyable listeners to exist.
The following code will return the closest entity to the player once the back input key is pressed.
val closestEntity by receiveNext<MovementEvent.InputUpdate, Entity>(
transform = { getClosestEntity<Entity>(player.eyePos, 7.0) },
) { it.input.pressingBack }It also allows to listen incoming events in an unorthodox way.
There are no practical uses outside of unsynchronized multi-threading where value loss is acceptable.
val events by listener<TickEvent.Pre>()Additional Information
No response
Pull Request
- I will be submitting a pull request
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
featureSuggests or adds a new featureSuggests or adds a new feature