java.lang.Object
io.github.tonywasher.joceanus.oceanus.event.OceanusEvent<E>
Type Parameters:
E - the event id type

public class OceanusEvent<E extends Enum<E>> extends Object
A generic event with action and item variants. For use by non-GUI components, or else GUI components that do not have these features.

Additionally listener interfaces for the events

  • Constructor Details

    • OceanusEvent

      protected OceanusEvent(int pSourceId, E pEventId)
      Constructor.
      Parameters:
      pSourceId - the id of the source of the event
      pEventId - the event id
    • OceanusEvent

      protected OceanusEvent(int pSourceId, E pEventId, Object pDetails)
      Constructor.
      Parameters:
      pSourceId - the id of the source of the event
      pEventId - the event id
      pDetails - the details of the event
  • Method Details

    • getSourceId

      public int getSourceId()
      Obtain the sourceId.
      Returns:
      the sourceId
    • getEventId

      public E getEventId()
      Obtain the eventId.
      Returns:
      the eventId
    • getDetails

      public Object getDetails()
      Obtain the details.
      Returns:
      the details
    • getDetails

      public <T> T getDetails(Class<T> pClazz)
      Obtain the details.
      Type Parameters:
      T - the details class
      Parameters:
      pClazz - the class of the details
      Returns:
      the details
    • isConsumed

      public boolean isConsumed()
      Is the event consumed?
      Returns:
      true/false
    • consume

      public void consume()
      Consume the event.