Interface Player<P extends Player<P,S>,S>

  • Type Parameters:
    P - the generic type
    S - The state if the player (dead, alive, strong, weak, king, queen, Pac-Man, ghost, fire, wood, water, strong queen, weak king, etc).
    All Superinterfaces:
    org.refcodes.graphical.DraggableAccessor, org.refcodes.graphical.DraggableAccessor.DraggableBuilder<P>, org.refcodes.graphical.DraggableAccessor.DraggableMutator, org.refcodes.graphical.DraggableAccessor.DraggableProperty, org.refcodes.observer.Observable<PlayerObserver<P,S>>, org.refcodes.graphical.Position, org.refcodes.graphical.Position.PositionBuilder<P>, org.refcodes.graphical.Position.PositionMutator, org.refcodes.graphical.Position.PositionProperty, org.refcodes.graphical.PosXAccessor, org.refcodes.graphical.PosXAccessor.PosXBuilder<P>, org.refcodes.graphical.PosXAccessor.PosXMutator, org.refcodes.graphical.PosXAccessor.PosXProperty, org.refcodes.graphical.PosYAccessor, org.refcodes.graphical.PosYAccessor.PosYBuilder<P>, org.refcodes.graphical.PosYAccessor.PosYMutator, org.refcodes.graphical.PosYAccessor.PosYProperty, org.refcodes.mixin.StateAccessor<S>, org.refcodes.mixin.StateAccessor.StateBuilder<S,P>, org.refcodes.mixin.StateAccessor.StateMutator<S>, org.refcodes.mixin.StateAccessor.StateProperty<S>, org.refcodes.graphical.VisibleAccessor, org.refcodes.graphical.VisibleAccessor.VisibleBuilder<P>, org.refcodes.graphical.VisibleAccessor.VisibleMutator, org.refcodes.graphical.VisibleAccessor.VisibleProperty
    All Known Subinterfaces:
    Taito<S>
    All Known Implementing Classes:
    AbstractPlayer, TaitoImpl

    public interface Player<P extends Player<P,S>,S>
    extends org.refcodes.graphical.Position.PositionProperty, org.refcodes.graphical.Position.PositionBuilder<P>, org.refcodes.observer.Observable<PlayerObserver<P,S>>, org.refcodes.mixin.StateAccessor.StateMutator<S>, org.refcodes.mixin.StateAccessor.StateProperty<S>, org.refcodes.mixin.StateAccessor.StateBuilder<S,P>, org.refcodes.graphical.VisibleAccessor.VisibleProperty, org.refcodes.graphical.VisibleAccessor.VisibleBuilder<P>, org.refcodes.graphical.DraggableAccessor.DraggableProperty, org.refcodes.graphical.DraggableAccessor.DraggableBuilder<P>
    A Player defines an actor (player) on a playground (checkerboard). It is observable in order to signal observers (checkerboard) on state updates.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.graphical.DraggableAccessor

        org.refcodes.graphical.DraggableAccessor.DraggableBuilder<B extends org.refcodes.graphical.DraggableAccessor.DraggableBuilder<B>>, org.refcodes.graphical.DraggableAccessor.DraggableMutator, org.refcodes.graphical.DraggableAccessor.DraggableProperty
      • Nested classes/interfaces inherited from interface org.refcodes.graphical.Position

        org.refcodes.graphical.Position.PositionBuilder<B extends org.refcodes.graphical.Position.PositionBuilder<B>>, org.refcodes.graphical.Position.PositionMutator, org.refcodes.graphical.Position.PositionProperty, org.refcodes.graphical.Position.PositionPropertyBuilder
      • Nested classes/interfaces inherited from interface org.refcodes.graphical.PosXAccessor

        org.refcodes.graphical.PosXAccessor.PosXBuilder<B extends org.refcodes.graphical.PosXAccessor.PosXBuilder<B>>, org.refcodes.graphical.PosXAccessor.PosXMutator, org.refcodes.graphical.PosXAccessor.PosXProperty
      • Nested classes/interfaces inherited from interface org.refcodes.graphical.PosYAccessor

        org.refcodes.graphical.PosYAccessor.PosYBuilder<B extends org.refcodes.graphical.PosYAccessor.PosYBuilder<B>>, org.refcodes.graphical.PosYAccessor.PosYMutator, org.refcodes.graphical.PosYAccessor.PosYProperty
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.StateAccessor

        org.refcodes.mixin.StateAccessor.StateBuilder<S extends java.lang.Object,B extends org.refcodes.mixin.StateAccessor.StateBuilder<S,B>>, org.refcodes.mixin.StateAccessor.StateMutator<S extends java.lang.Object>, org.refcodes.mixin.StateAccessor.StateProperty<S extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.graphical.VisibleAccessor

        org.refcodes.graphical.VisibleAccessor.VisibleBuilder<B extends org.refcodes.graphical.VisibleAccessor.VisibleBuilder<B>>, org.refcodes.graphical.VisibleAccessor.VisibleMutator, org.refcodes.graphical.VisibleAccessor.VisibleProperty
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void blink()
      Causes the Player to blink.
      void click()
      Selects ("clicks") the player.
      default void moveDown()
      Moves the player one down.
      default void moveLeft()
      Moves the player one to the left.
      default void moveRight()
      Moves the player one to the right.
      default void moveUp()
      Moves the player one up.
      default PlayerObserver<P,S> onChangePosition​(ChangePositionObserver<P> aObserver)
      Registers an according observer.
      default PlayerObserver<P,S> onClicked​(ClickedObserver<P> aObserver)
      Registers an according observer.
      default PlayerObserver<P,S> onDraggabilityChanged​(DraggabilityChangedObserver<P> aObserver)
      Registers an according observer.
      default PlayerObserver<P,S> onPositionChanged​(PositionChangedObserver<P> aObserver)
      Registers an according observer.
      default PlayerObserver<P,S> onStateChanged​(StateChangedObserver<P,S> aObserver)
      Registers an according observer.
      default PlayerObserver<P,S> onVisibilityChanged​(VisibilityChangedObserver<P> aObserver)
      Registers an according observer.
      • Methods inherited from interface org.refcodes.graphical.DraggableAccessor

        isDraggable
      • Methods inherited from interface org.refcodes.graphical.DraggableAccessor.DraggableBuilder

        withDraggable, withDraggable, withStationary
      • Methods inherited from interface org.refcodes.graphical.DraggableAccessor.DraggableMutator

        draggable, setDraggable, stationary
      • Methods inherited from interface org.refcodes.observer.Observable

        hasObserverSubscription, subscribeObserver, unsubscribeObserver
      • Methods inherited from interface org.refcodes.graphical.Position

        toAddTo, toSubFrom
      • Methods inherited from interface org.refcodes.graphical.Position.PositionBuilder

        withPosition, withPosition
      • Methods inherited from interface org.refcodes.graphical.Position.PositionMutator

        setPosition, setPosition
      • Methods inherited from interface org.refcodes.graphical.Position.PositionProperty

        addTo, subFrom
      • Methods inherited from interface org.refcodes.graphical.PosXAccessor

        getPositionX
      • Methods inherited from interface org.refcodes.graphical.PosXAccessor.PosXBuilder

        withPositionX
      • Methods inherited from interface org.refcodes.graphical.PosXAccessor.PosXMutator

        setPositionX
      • Methods inherited from interface org.refcodes.graphical.PosYAccessor

        getPositionY
      • Methods inherited from interface org.refcodes.graphical.PosYAccessor.PosYBuilder

        withPositionY
      • Methods inherited from interface org.refcodes.graphical.PosYAccessor.PosYMutator

        setPositionY
      • Methods inherited from interface org.refcodes.mixin.StateAccessor

        getState
      • Methods inherited from interface org.refcodes.mixin.StateAccessor.StateBuilder

        withState
      • Methods inherited from interface org.refcodes.mixin.StateAccessor.StateMutator

        setState
      • Methods inherited from interface org.refcodes.graphical.VisibleAccessor

        isVisible
      • Methods inherited from interface org.refcodes.graphical.VisibleAccessor.VisibleBuilder

        withHide, withShow, withVisible
      • Methods inherited from interface org.refcodes.graphical.VisibleAccessor.VisibleMutator

        hide, setVisible, show
    • Method Detail

      • blink

        default void blink()
        Causes the Player to blink.
      • moveRight

        default void moveRight()
        Moves the player one to the right.
      • moveLeft

        default void moveLeft()
        Moves the player one to the left.
      • moveUp

        default void moveUp()
        Moves the player one up.
      • moveDown

        default void moveDown()
        Moves the player one down.
      • click

        void click()
        Selects ("clicks") the player.
      • onChangePosition

        default PlayerObserver<P,S> onChangePosition​(ChangePositionObserver<P> aObserver)
        Registers an according observer. For unregistering, use the returned handle.
        Parameters:
        aObserver - The observer to be registered.
        Returns:
        The accordingly registered PlayerObserver.
      • onPositionChanged

        default PlayerObserver<P,S> onPositionChanged​(PositionChangedObserver<P> aObserver)
        Registers an according observer. For unregistering, use the returned handle.
        Parameters:
        aObserver - The observer to be registered.
        Returns:
        The accordingly registered PlayerObserver.
      • onStateChanged

        default PlayerObserver<P,S> onStateChanged​(StateChangedObserver<P,S> aObserver)
        Registers an according observer. For unregistering, use the returned handle.
        Parameters:
        aObserver - The observer to be registered.
        Returns:
        The accordingly registered PlayerObserver.
      • onVisibilityChanged

        default PlayerObserver<P,S> onVisibilityChanged​(VisibilityChangedObserver<P> aObserver)
        Registers an according observer. For unregistering, use the returned handle.
        Parameters:
        aObserver - The observer to be registered.
        Returns:
        The accordingly registered PlayerObserver.
      • onDraggabilityChanged

        default PlayerObserver<P,S> onDraggabilityChanged​(DraggabilityChangedObserver<P> aObserver)
        Registers an according observer. For unregistering, use the returned handle.
        Parameters:
        aObserver - The observer to be registered.
        Returns:
        The accordingly registered PlayerObserver.
      • onClicked

        default PlayerObserver<P,S> onClicked​(ClickedObserver<P> aObserver)
        Registers an according observer. For unregistering, use the returned handle.
        Parameters:
        aObserver - The observer to be registered.
        Returns:
        The accordingly registered PlayerObserver.