Package arc

Class Events

java.lang.Object
arc.Events

public class Events extends Object
Simple global event listener system.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Don't do this.
    static <T> void
    fire(Class<?> ctype, T type)
     
    static <T extends Enum<T>>
    void
    fire(Enum<T> type)
    Fires an enum trigger.
    static <T> void
    fire(T type)
    Fires a non-enum event by class.
    static <T> void
    on(Class<T> type, Cons<T> listener)
    Handle an event by class.
    static <T> boolean
    remove(Class<T> type, Cons<T> listener)
    Only use this method if you have the reference to the exact listener object that was used.
    static void
    run(Object type, Runnable listener)
    Handle an event by enum trigger.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Events

      public Events()
  • Method Details

    • on

      public static <T> void on(Class<T> type, Cons<T> listener)
      Handle an event by class.
    • run

      public static void run(Object type, Runnable listener)
      Handle an event by enum trigger.
    • remove

      public static <T> boolean remove(Class<T> type, Cons<T> listener)
      Only use this method if you have the reference to the exact listener object that was used.
    • fire

      public static <T extends Enum<T>> void fire(Enum<T> type)
      Fires an enum trigger.
    • fire

      public static <T> void fire(T type)
      Fires a non-enum event by class.
    • fire

      public static <T> void fire(Class<?> ctype, T type)
    • clear

      public static void clear()
      Don't do this.