EVENT - public abstract class EventReactOnce<EVENT extends IWorldEvent> extends EventReact<EVENT>
IWorldEvent for you and calls EventReact.react(IWorldEvent)
method automatically. The EventReact.react(IWorldEvent) will be called only once (upon first event received).
If you need to react every time, use EventReact.
Use EventReact.enable() and EventReact.disable() to enable react / disable react. The reaction is enabled
as default.
WARNING:Use as anonymous class, but save it as a field of your class! Note, that we're using weak-references to
listeners and if you do not save pointer to the object, it will be gc()ed!
reactEventClass, reactListener, reactWorldView| Constructor and Description |
|---|
EventReactOnce(Class<EVENT> eventClass,
IWorldView worldView) |
public EventReactOnce(Class<EVENT> eventClass, IWorldView worldView)
protected void postReact(EVENT event)
postReact in class EventReact<EVENT extends IWorldEvent>Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.