Who has never be in need to cancel a posted event?
JPEvent is a very useful tool. With this tool, you will be able to control events you have posted. It allows you to cancel events, to pause or resume them, and also to add some additional delay.
You will be able to do actions on several events at once, thanks to the patterns support.
JPEvent provides various functions, to target object events only, user events, events sent in a scene or in the whole application. Here are a couple of functions:
All of the available functions can be found in the API page of JPEvent.
JPEvent also provides a new feature when sending events, the possibility to use a pattern in place of the AIModel name. With this king of feature, you will be able to send events to several AIModels at once. This feature works for both users and objects, with postEvent, sendEvent and sendEventImmediate. Also, 3 new functions are available, to be able to send events to the current user without having to use its handle:
Finally, it offers a very interesting feature: it sends a "onWillBeDestroyed" to any AIModel, just before it will be destroyed. This is really great, it allows you for instance to free the allocated resources during the AIModel life time. It works for any AIModel, for both users and objetcs, an occurs in the following cases:
- When you manually call removeAIModel
- When a scene is closed
- When a user or object is destroyed
- When the application quits or is restarted