Class EventDispatcherImpl


  • public class EventDispatcherImpl
    extends com.runemate.game.api.script.framework.core.EventDispatcher
    Processes and dispatches events to the registered listeners.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.runemate.game.api.script.framework.core.EventDispatcher

        com.runemate.game.api.script.framework.core.EventDispatcher.Companion
    • Field Summary

      • Fields inherited from class com.runemate.game.api.script.framework.core.EventDispatcher

        Companion, listeners
    • Constructor Summary

      Constructors 
      Constructor Description
      EventDispatcherImpl​(com.runemate.game.api.script.framework.AbstractBot bot)  
    • Constructor Detail

      • EventDispatcherImpl

        public EventDispatcherImpl​(com.runemate.game.api.script.framework.AbstractBot bot)
    • 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 class com.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 class com.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 class com.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 class com.runemate.game.api.script.framework.core.EventDispatcher
      • createConnectionStateEvent

        public void createConnectionStateEvent​(int old,
                                               int current)
        Specified by:
        createConnectionStateEvent in class com.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 class com.runemate.game.api.script.framework.core.EventDispatcher
      • createEngineCycleEvent

        public void createEngineCycleEvent()
        Specified by:
        createEngineCycleEvent in class com.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 class com.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 class com.runemate.game.api.script.framework.core.EventDispatcher
      • createPlayerMovedEvent

        public void createPlayerMovedEvent​(long playerUid)
        Specified by:
        createPlayerMovedEvent in class com.runemate.game.api.script.framework.core.EventDispatcher
      • createProjectileLaunchEvent

        public void createProjectileLaunchEvent​(long uid)
        Specified by:
        createProjectileLaunchEvent in class com.runemate.game.api.script.framework.core.EventDispatcher
      • createRegionLoadedEvent

        public void createRegionLoadedEvent​(int x,
                                            int y)
        Specified by:
        createRegionLoadedEvent in class com.runemate.game.api.script.framework.core.EventDispatcher
      • createScriptStartEvent

        public void createScriptStartEvent​(int scriptId,
                                           @Nullable
                                           @Nullable java.lang.Object[] scriptArgs)
        Specified by:
        createScriptStartEvent in class com.runemate.game.api.script.framework.core.EventDispatcher
      • createServerTickEvent

        public void createServerTickEvent()
        Specified by:
        createServerTickEvent in class com.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 class com.runemate.game.api.script.framework.core.EventDispatcher
      • createVarbitEvent

        public void createVarbitEvent​(int index,
                                      int old,
                                      int value)
        Specified by:
        createVarbitEvent in class com.runemate.game.api.script.framework.core.EventDispatcher
      • createVarcIntEvent

        public void createVarcIntEvent​(int index,
                                       int old,
                                       int value)
        Specified by:
        createVarcIntEvent in class com.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 class com.runemate.game.api.script.framework.core.EventDispatcher
      • createVarpEvent

        public void createVarpEvent​(int index,
                                    int old,
                                    int value)
        Specified by:
        createVarpEvent in class com.runemate.game.api.script.framework.core.EventDispatcher
      • createNpcSpawnEvent

        public void createNpcSpawnEvent​(long uid)
        Specified by:
        createNpcSpawnEvent in class com.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 class com.runemate.game.api.script.framework.core.EventDispatcher
      • createProjectileMovedEvent

        public void createProjectileMovedEvent​(long uid,
                                               int x,
                                               int y)
        Specified by:
        createProjectileMovedEvent in class com.runemate.game.api.script.framework.core.EventDispatcher
      • createSpotAnimationEvent

        public void createSpotAnimationEvent​(int x,
                                             int y,
                                             int plane,
                                             long uid)
        Specified by:
        createSpotAnimationEvent in class com.runemate.game.api.script.framework.core.EventDispatcher
      • createGroundItemEvent

        public void createGroundItemEvent​(int x,
                                          int y,
                                          int plane,
                                          long uid)
        Specified by:
        createGroundItemEvent in class com.runemate.game.api.script.framework.core.EventDispatcher
      • forceSequentialDispatching

        public void forceSequentialDispatching​(boolean enable)
        Specified by:
        forceSequentialDispatching in class com.runemate.game.api.script.framework.core.EventDispatcher
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in class com.runemate.game.api.script.framework.core.EventDispatcher