Class EventDispatcherImpl
- java.lang.Object
-
- com.runemate.game.api.script.framework.core.EventDispatcher
-
- com.runemate.game.internal.events.EventDispatcherImpl
-
public class EventDispatcherImpl extends com.runemate.game.api.script.framework.core.EventDispatcher
Processes and dispatches events to the registered listeners.
-
-
Constructor Summary
Constructors Constructor Description EventDispatcherImpl(com.runemate.game.api.script.framework.AbstractBot bot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(java.util.EventListener listener)
Registers a listener to dispatch in-game events tovoid
createAnimationEvent(@NonNull java.lang.String type, long characterUid, int animationId)
void
createChatboxEvent(int type, @NonNull java.lang.String sender, @NonNull java.lang.String message)
void
createConnectionStateEvent(int old, int current)
void
createDeathEvent(@NonNull java.lang.String type, long actorUid, int gameCycle)
void
createEngineCycleEvent()
void
createEventObjectSpawnEvent(int x, int y, int plane, long uid, java.lang.String type, int id)
void
createGroundItemEvent(int x, int y, int plane, long uid)
void
createHitsplatEvent(@NonNull java.lang.String type, long actorUid, int typeId, int damage, int specialTypeId, int startCyle, int endCycle)
void
createMenuInteractionEvent(int arg0, int arg1, int opcode, int identifier, @NonNull java.lang.String action, @NonNull java.lang.String target, int mx, int my)
void
createNpcSpawnEvent(long uid)
void
createPlayerMovedEvent(long playerUid)
void
createProjectileLaunchEvent(long uid)
void
createProjectileMovedEvent(long uid, int x, int y)
void
createRegionLoadedEvent(int x, int y)
void
createScriptStartEvent(int scriptId, @Nullable java.lang.Object[] scriptArgs)
void
createServerTickEvent()
void
createSpotAnimationEvent(int x, int y, int plane, long uid)
void
createTargetEvent(@NonNull java.lang.String type, long actorUid, int targetIndex)
void
createVarbitEvent(int index, int old, int value)
void
createVarcIntEvent(int index, int old, int value)
void
createVarcStringEvent(int index, java.lang.String old, java.lang.String value)
void
createVarpEvent(int index, int old, int value)
void
dispatchLater(com.runemate.game.api.script.framework.listeners.events.Event event)
Forwards an event to the registered listeners of the correct type.void
forceSequentialDispatching(boolean enable)
void
shutdown()
-
-
-
Method Detail
-
dispatchLater
public void dispatchLater(com.runemate.game.api.script.framework.listeners.events.Event event)
Forwards an event to the registered listeners of the correct type.- Specified by:
dispatchLater
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
addListener
public void addListener(java.util.EventListener listener)
Registers a listener to dispatch in-game events to- Specified by:
addListener
in classcom.runemate.game.api.script.framework.core.EventDispatcher
- Parameters:
listener
- a listener (PaintListener, MouseListener, KeyListener, etc)
-
createAnimationEvent
public void createAnimationEvent(@NonNull @NonNull java.lang.String type, long characterUid, int animationId)
- Specified by:
createAnimationEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createChatboxEvent
public void createChatboxEvent(int type, @NonNull @NonNull java.lang.String sender, @NonNull @NonNull java.lang.String message)
- Specified by:
createChatboxEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createConnectionStateEvent
public void createConnectionStateEvent(int old, int current)
- Specified by:
createConnectionStateEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createDeathEvent
public void createDeathEvent(@NonNull @NonNull java.lang.String type, long actorUid, int gameCycle)
- Specified by:
createDeathEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createEngineCycleEvent
public void createEngineCycleEvent()
- Specified by:
createEngineCycleEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createHitsplatEvent
public void createHitsplatEvent(@NonNull @NonNull java.lang.String type, long actorUid, int typeId, int damage, int specialTypeId, int startCyle, int endCycle)
- Specified by:
createHitsplatEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createMenuInteractionEvent
public void createMenuInteractionEvent(int arg0, int arg1, int opcode, int identifier, @NonNull @NonNull java.lang.String action, @NonNull @NonNull java.lang.String target, int mx, int my)
- Specified by:
createMenuInteractionEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createPlayerMovedEvent
public void createPlayerMovedEvent(long playerUid)
- Specified by:
createPlayerMovedEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createProjectileLaunchEvent
public void createProjectileLaunchEvent(long uid)
- Specified by:
createProjectileLaunchEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createRegionLoadedEvent
public void createRegionLoadedEvent(int x, int y)
- Specified by:
createRegionLoadedEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createScriptStartEvent
public void createScriptStartEvent(int scriptId, @Nullable @Nullable java.lang.Object[] scriptArgs)
- Specified by:
createScriptStartEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createServerTickEvent
public void createServerTickEvent()
- Specified by:
createServerTickEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createTargetEvent
public void createTargetEvent(@NonNull @NonNull java.lang.String type, long actorUid, int targetIndex)
- Specified by:
createTargetEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createVarbitEvent
public void createVarbitEvent(int index, int old, int value)
- Specified by:
createVarbitEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createVarcIntEvent
public void createVarcIntEvent(int index, int old, int value)
- Specified by:
createVarcIntEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createVarcStringEvent
public void createVarcStringEvent(int index, java.lang.String old, java.lang.String value)
- Specified by:
createVarcStringEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createVarpEvent
public void createVarpEvent(int index, int old, int value)
- Specified by:
createVarpEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createNpcSpawnEvent
public void createNpcSpawnEvent(long uid)
- Specified by:
createNpcSpawnEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createEventObjectSpawnEvent
public void createEventObjectSpawnEvent(int x, int y, int plane, long uid, java.lang.String type, int id)
- Specified by:
createEventObjectSpawnEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createProjectileMovedEvent
public void createProjectileMovedEvent(long uid, int x, int y)
- Specified by:
createProjectileMovedEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createSpotAnimationEvent
public void createSpotAnimationEvent(int x, int y, int plane, long uid)
- Specified by:
createSpotAnimationEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
createGroundItemEvent
public void createGroundItemEvent(int x, int y, int plane, long uid)
- Specified by:
createGroundItemEvent
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
forceSequentialDispatching
public void forceSequentialDispatching(boolean enable)
- Specified by:
forceSequentialDispatching
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
shutdown
public void shutdown()
- Specified by:
shutdown
in classcom.runemate.game.api.script.framework.core.EventDispatcher
-
-