3 ms·
For me it does just the opposite. Since each event class has its own dispatcher, the question of which dispatcher disappears. RegionEvent.create( RegionEvent.A
by BatFastard 9y ago
For me it does just the opposite. Since each event class has its own dispatcher, the question of which dispatcher disappears.
RegionEvent.create( RegionEvent.ADD_MODEL, series, guid, modelData );
The dispatcher is internal to the RegionEvent. The other great thing here is the custom events allow me to pass the type of parameters that are appropriate for this class.
which is handled by
RegionEvent.addListener( RegionEvent.ADD_MODEL, addModel );
I also use the rule that all event have to be treated as async events. This pattern works great for non real time portions of my engine.
- gravypod 9y agoThat's very nice. I'll have to give this a try in my work. Never thought about that.