This repository has been archived on 2021-02-18. You can view files and clone it, but cannot push or open issues or pull requests.
chess/src/main/java/dev/kske/chess/event/Subscriber.java

32 lines
792 B
Java

package dev.kske.chess.event;
import java.util.Set;
/**
* Implementations of this interface can register themselves at the
* {@link EventBus} and will be triggered every time an {@link Event} of a
* supported type.<br>
* <br>
* Project: <strong>Chess</strong><br>
* File: <strong>Subscribable.java</strong><br>
* Created: <strong>7 Aug 2019</strong><br>
*
* @since Chess v0.4-alpha
* @author Kai S. K. Engelbart
*/
public interface Subscriber {
/**
* Consumes an event dispatched by an event bus.
*
* @param event The event dispatched by the event bus, only of supported
* type
*/
void handle(Event<?> event);
/**
* @return A set of classes this class is supposed to handle in events
*/
Set<Class<?>> supports();
}