Class SignalEmitEvent

java.lang.Object
com.chillycheesy.modulo.events.Event
com.chillycheesy.modulo.event.SignalEmitEvent

public class SignalEmitEvent extends Event
Event emits when a signal is emitted.
  • Constructor Details

    • SignalEmitEvent

      public SignalEmitEvent(Module signalEmitter, Module[] receptors, String signal, String[] args)
      Create a new SignalEmitEvent.
      Parameters:
      signalEmitter - The Module that emits the signal.
      receptors - The Module that will receive the signal and invoke a method.
      signal - The signal name that has been emitted.
      args - The args of the signal.
    • SignalEmitEvent

      public SignalEmitEvent(Module signalEmitter, String signal, String[] args)
      Create a new SignalEmitEvent.
      Parameters:
      signalEmitter - The Module that emits the signal.
      signal - The signal name that has been emitted.
      args - The args of the signal. By calling this constructor, the receptors will be an empty array.
  • Method Details

    • haveReceptors

      public boolean haveReceptors()
      Check if the signal was receive.
      Returns:
      True if at least one Module has catch the signal.
    • setSignalEmitter

      public void setSignalEmitter(Module signalEmitter)
      Setter for the emitter module.
      Parameters:
      signalEmitter - The new signal emitter.
    • setReceptors

      public void setReceptors(Module[] receptors)
      Setter for the receptors module.
      Parameters:
      receptors - The new receptors.
    • getSignalEmitter

      public Module getSignalEmitter()
      Getter for the signal emitter.
      Returns:
      The signal emitter.
    • setSignal

      public void setSignal(String signal)
      Setter for the signal.
      Parameters:
      signal - The signal.
    • setArgs

      public void setArgs(String[] args)
      Setter for the arguments.
      Parameters:
      args - The arguments.
    • getReceptor

      public Module[] getReceptor()
      Getter for the receptor.
      Returns:
      The receptor.
    • getSignal

      public String getSignal()
      Getter for the signal.
      Returns:
      The signal.
    • getArgs

      public String[] getArgs()
      Getter for the arguments.
      Returns:
      The arguments.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object