25 lines
584 B
Java
25 lines
584 B
Java
|
package dev.kske.chess.event;
|
||
|
|
||
|
import java.util.Set;
|
||
|
|
||
|
/**
|
||
|
* Project: <strong>Chess</strong><br>
|
||
|
* File: <strong>Subscribable.java</strong><br>
|
||
|
* Created: <strong>7 Aug 2019</strong><br>
|
||
|
* Author: <strong>Kai S. K. Engelbart</strong>
|
||
|
*/
|
||
|
public interface Subscribable {
|
||
|
|
||
|
/**
|
||
|
* 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();
|
||
|
}
|