org.refcodes.checkerboard.PlayerObserver Maven / Gradle / Ivy
package org.refcodes.checkerboard;
import org.refcodes.exception.VetoException;
/**
* An asynchronous update interface for receiving notifications about Player
* information as the Player is constructed.
*
* @param the generic type
* @param the generic type
*/
@FunctionalInterface
public interface PlayerObserver
, S> extends ClickedObserver
, ChangePositionObserver
, PositionChangedObserver
, StateChangedObserver
, VisibilityChangedObserver
, DraggabilityChangedObserver
{
/**
* This method is called when information about an Player which was
* previously requested using an asynchronous interface becomes available.
*
* @param aPlayerEvent the player event
*/
void onPlayerEvent( PlayerEvent
aPlayerEvent );
/**
* {@inheritDoc}
*/
@Override
default void onChangePositionEvent( ChangePositionEvent
aPlayerEvent ) throws VetoException {}
/**
* {@inheritDoc}
*/
@Override
default void onPositionChangedEvent( PositionChangedEvent
aPlayerEvent ) {}
/**
* {@inheritDoc}
*/
@Override
default void onStateChangedEvent( StateChangedEvent
aPlayerEvent ) {}
/**
* {@inheritDoc}
*/
@Override
default void onVisibilityChangedEvent( VisibilityChangedEvent
aPlayerEvent ) {}
/**
* {@inheritDoc}
*/
@Override
default void onDraggabilityChangedEvent( DraggabilityChangedEvent
aPlayerEvent ) {}
/**
* {@inheritDoc}
*/
@Override
default void onClickedEvent( ClickedEvent
aPlayerEvent ) {}
}