Class PlayerStateChangedEvent<P extends Player<P,S>,S>

java.lang.Object
org.refcodes.checkerboard.AbstractPlayerEvent<P>
org.refcodes.checkerboard.PlayerStateChangedEvent<P,S>
Type Parameters:
P - the generic type
S - The state of the player (dead, alive, strong, weak, king, queen, PacMan, ghost, fire, wood, water, strong queen, weak king, etc).
All Implemented Interfaces:
PlayerEvent<P>, org.refcodes.mixin.ActionAccessor<PlayerAction>, org.refcodes.mixin.SourceAccessor<P>, org.refcodes.mixin.StatusAccessor<S>, org.refcodes.observer.ActionEvent<PlayerAction,P>, org.refcodes.observer.Event<P>

public class PlayerStateChangedEvent<P extends Player<P,S>,S> extends AbstractPlayerEvent<P> implements org.refcodes.mixin.StatusAccessor<S>
The class PlayerStateChangedEvent.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.refcodes.mixin.ActionAccessor

    org.refcodes.mixin.ActionAccessor.ActionBuilder<A extends Object,B extends org.refcodes.mixin.ActionAccessor.ActionBuilder<A,B>>, org.refcodes.mixin.ActionAccessor.ActionMutator<A extends Object>, org.refcodes.mixin.ActionAccessor.ActionProperty<A extends Object>

    Nested classes/interfaces inherited from interface org.refcodes.mixin.SourceAccessor

    org.refcodes.mixin.SourceAccessor.SourceBuilder<SRC extends Object,B extends org.refcodes.mixin.SourceAccessor.SourceBuilder<SRC,B>>, org.refcodes.mixin.SourceAccessor.SourceMutator<SRC extends Object>, org.refcodes.mixin.SourceAccessor.SourceProperty<SRC extends Object>

    Nested classes/interfaces inherited from interface org.refcodes.mixin.StatusAccessor

    org.refcodes.mixin.StatusAccessor.StatusBuilder<S extends Object,B extends org.refcodes.mixin.StatusAccessor.StatusBuilder<S,B>>, org.refcodes.mixin.StatusAccessor.StatusMutator<S extends Object>, org.refcodes.mixin.StatusAccessor.StatusProperty<S extends Object>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final PlayerAction
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayerStateChangedEvent(S aState, S aPrecedingState, P aSource)
    Instantiates a new state changed event.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the preceding state.

    Methods inherited from class org.refcodes.checkerboard.AbstractPlayerEvent

    getAction, getSource

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • PlayerStateChangedEvent

      public PlayerStateChangedEvent(S aState, S aPrecedingState, P aSource)
      Instantiates a new state changed event.
      Parameters:
      aState - the state
      aPrecedingState - the preceding state
      aSource - The according source (origin).
  • Method Details

    • getStatus

      public S getStatus()
      Specified by:
      getStatus in interface org.refcodes.mixin.StatusAccessor<P extends Player<P,S>>
    • getPrecedingState

      public S getPrecedingState()
      Gets the preceding state.
      Returns:
      the preceding state
    • toString

      public String toString()
      Overrides:
      toString in class AbstractPlayerEvent<P extends Player<P,S>>