COMMAND - public abstract class CommandReactOnce<COMMAND extends CommandMessage> extends CommandReact<COMMAND>
IWorldCommand for you and calls CommandReactOnce#react(IWorldCommand)
method automatically. The CommandReactOnce#react(IWorldCommand) will be called only once (upon first event received).
If you need to react every time, use CommandReact.
Use CommandReact.enable() and CommandReact.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!
reactAct, reactCommandClass, reactListener| Constructor and Description |
|---|
CommandReactOnce(Class<COMMAND> commandClass,
IAct act) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
postReact(COMMAND event)
Disables the reaction.
|
disable, enable, preReact, reactprotected void postReact(COMMAND event)
postReact in class CommandReact<COMMAND extends CommandMessage>Copyright © 2019 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.