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

  • Type Parameters:
    P - the generic type
    S - the generic type
    All Superinterfaces:
    org.refcodes.component.Component, org.refcodes.component.Destroyable, org.refcodes.graphical.GridDimension, org.refcodes.graphical.GridDimension.GridDimensionBuilder<Checkerboard<P,S>>, org.refcodes.graphical.GridDimension.GridDimensionMutator, org.refcodes.graphical.GridDimension.GridDimensionProperty, org.refcodes.graphical.GridHeightAccessor, org.refcodes.graphical.GridHeightAccessor.GridHeightBuilder<Checkerboard<P,S>>, org.refcodes.graphical.GridHeightAccessor.GridHeightMutator, org.refcodes.graphical.GridHeightAccessor.GridHeightProperty, org.refcodes.graphical.GridModeAccessor, org.refcodes.graphical.GridModeAccessor.GridModeBuilder<Checkerboard<P,S>>, org.refcodes.graphical.GridModeAccessor.GridModeMutator, org.refcodes.graphical.GridModeAccessor.GridModeProperty, org.refcodes.graphical.GridWidthAccessor, org.refcodes.graphical.GridWidthAccessor.GridWidthBuilder<Checkerboard<P,S>>, org.refcodes.graphical.GridWidthAccessor.GridWidthMutator, org.refcodes.graphical.GridWidthAccessor.GridWidthProperty, org.refcodes.observer.Observable<CheckerboardObserver<P,S>>, Players<P>
    All Known Implementing Classes:
    CheckerboardImpl

    public interface Checkerboard<P extends Player<P,S>,S>
    extends Players<P>, org.refcodes.observer.Observable<CheckerboardObserver<P,S>>, org.refcodes.graphical.GridDimension.GridDimensionProperty, org.refcodes.graphical.GridDimension.GridDimensionBuilder<Checkerboard<P,S>>, org.refcodes.graphical.GridModeAccessor.GridModeProperty, org.refcodes.graphical.GridModeAccessor.GridModeBuilder<Checkerboard<P,S>>, org.refcodes.component.Component
    The Interface Checkerboard.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.component.Destroyable

        org.refcodes.component.Destroyable.DestroyAutomaton
      • Nested classes/interfaces inherited from interface org.refcodes.graphical.GridDimension

        org.refcodes.graphical.GridDimension.GridDimensionBuilder<B extends org.refcodes.graphical.GridDimension.GridDimensionBuilder<B>>, org.refcodes.graphical.GridDimension.GridDimensionMutator, org.refcodes.graphical.GridDimension.GridDimensionProperty, org.refcodes.graphical.GridDimension.GridDimensionPropertyBuilder
      • Nested classes/interfaces inherited from interface org.refcodes.graphical.GridHeightAccessor

        org.refcodes.graphical.GridHeightAccessor.GridHeightBuilder<B extends org.refcodes.graphical.GridHeightAccessor.GridHeightBuilder<B>>, org.refcodes.graphical.GridHeightAccessor.GridHeightMutator, org.refcodes.graphical.GridHeightAccessor.GridHeightProperty
      • Nested classes/interfaces inherited from interface org.refcodes.graphical.GridModeAccessor

        org.refcodes.graphical.GridModeAccessor.GridModeBuilder<B extends org.refcodes.graphical.GridModeAccessor.GridModeBuilder<B>>, org.refcodes.graphical.GridModeAccessor.GridModeMutator, org.refcodes.graphical.GridModeAccessor.GridModeProperty
      • Nested classes/interfaces inherited from interface org.refcodes.graphical.GridWidthAccessor

        org.refcodes.graphical.GridWidthAccessor.GridWidthBuilder<B extends org.refcodes.graphical.GridWidthAccessor.GridWidthBuilder<B>>, org.refcodes.graphical.GridWidthAccessor.GridWidthMutator, org.refcodes.graphical.GridWidthAccessor.GridWidthProperty
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      P atBottomLeftOf​(org.refcodes.graphical.Position aPos)
      At bottom left of.
      P atBottomOf​(org.refcodes.graphical.Position aPos)
      At bottom of.
      P atBottomRightOf​(org.refcodes.graphical.Position aPos)
      At bottom right of.
      P atLeftOf​(org.refcodes.graphical.Position aPos)
      At left of.
      P atPosition​(int aPosX, int aPosY)
      At position.
      P atPosition​(org.refcodes.graphical.Position aPos)
      At position.
      P atRightOf​(org.refcodes.graphical.Position aPos)
      At right of.
      P atTopLeftOf​(org.refcodes.graphical.Position aPos)
      At top left of.
      P atTopOf​(org.refcodes.graphical.Position aPos)
      At top of.
      P atTopRightOf​(org.refcodes.graphical.Position aPos)
      At top right of.
      void forEach​(java.util.function.Consumer<P> aConsumer)
      Performs the given action for each Player on the Checkerboard until all players have been processed or the action throws an exception.
      java.util.Map<java.lang.Integer,P> getColumn​(int aColumn)
      Gets the column.
      java.util.Map<java.lang.Integer,P> getRow​(int aRow)
      Gets the row.
      boolean hasAtBottomLeftOf​(org.refcodes.graphical.Position aPos)
      Checks for at bottom left of.
      boolean hasAtBottomOf​(org.refcodes.graphical.Position aPos)
      Checks for at bottom of.
      boolean hasAtBottomRightOf​(org.refcodes.graphical.Position aPos)
      Checks for at bottom right of.
      boolean hasAtLeftOf​(org.refcodes.graphical.Position aPos)
      Checks for at left of.
      boolean hasAtPosition​(int aPosX, int aPosY)
      Checks for at position.
      boolean hasAtPosition​(org.refcodes.graphical.Position aPos)
      Checks for at position.
      boolean hasAtRightOf​(org.refcodes.graphical.Position aPos)
      Checks for at right of.
      boolean hasAtTopLeftOf​(org.refcodes.graphical.Position aPos)
      Checks for at top left of.
      boolean hasAtTopOf​(org.refcodes.graphical.Position aPos)
      Checks for at top of.
      boolean hasAtTopRightOf​(org.refcodes.graphical.Position aPos)
      Checks for at top right of.
      • Methods inherited from interface org.refcodes.component.Destroyable

        destroy
      • Methods inherited from interface org.refcodes.graphical.GridDimension

        isInBounds, isInBounds, isInHeight, isInWidth
      • Methods inherited from interface org.refcodes.graphical.GridDimension.GridDimensionBuilder

        withGridDimension, withGridDimension, withGridDimension
      • Methods inherited from interface org.refcodes.graphical.GridDimension.GridDimensionMutator

        setGridDimension, setGridDimension, setGridDimension
      • Methods inherited from interface org.refcodes.graphical.GridHeightAccessor

        getGridHeight
      • Methods inherited from interface org.refcodes.graphical.GridHeightAccessor.GridHeightBuilder

        withGridHeight
      • Methods inherited from interface org.refcodes.graphical.GridHeightAccessor.GridHeightMutator

        setGridHeight
      • Methods inherited from interface org.refcodes.graphical.GridModeAccessor

        getGridMode
      • Methods inherited from interface org.refcodes.graphical.GridModeAccessor.GridModeBuilder

        withGridMode
      • Methods inherited from interface org.refcodes.graphical.GridModeAccessor.GridModeMutator

        setGridMode
      • Methods inherited from interface org.refcodes.graphical.GridWidthAccessor

        getGridWidth
      • Methods inherited from interface org.refcodes.graphical.GridWidthAccessor.GridWidthBuilder

        withGridWidth
      • Methods inherited from interface org.refcodes.graphical.GridWidthAccessor.GridWidthMutator

        setGridWidth
      • Methods inherited from interface org.refcodes.observer.Observable

        hasObserverSubscription, subscribeObserver, unsubscribeObserver
    • Method Detail

      • hasAtPosition

        boolean hasAtPosition​(org.refcodes.graphical.Position aPos)
                       throws java.lang.IndexOutOfBoundsException
        Checks for at position.
        Parameters:
        aPos - the pos
        Returns:
        true, if successful
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • hasAtPosition

        boolean hasAtPosition​(int aPosX,
                              int aPosY)
                       throws java.lang.IndexOutOfBoundsException
        Checks for at position.
        Parameters:
        aPosX - the pos X
        aPosY - the pos Y
        Returns:
        true, if successful
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • atPosition

        P atPosition​(org.refcodes.graphical.Position aPos)
              throws java.lang.IndexOutOfBoundsException
        At position.
        Parameters:
        aPos - the pos
        Returns:
        the p
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • atPosition

        P atPosition​(int aPosX,
                     int aPosY)
              throws java.lang.IndexOutOfBoundsException
        At position.
        Parameters:
        aPosX - the pos X
        aPosY - the pos Y
        Returns:
        the p
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • getRow

        java.util.Map<java.lang.Integer,P> getRow​(int aRow)
                                           throws java.lang.IndexOutOfBoundsException
        Gets the row.
        Parameters:
        aRow - the row
        Returns:
        the row
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • getColumn

        java.util.Map<java.lang.Integer,P> getColumn​(int aColumn)
                                              throws java.lang.IndexOutOfBoundsException
        Gets the column.
        Parameters:
        aColumn - the column
        Returns:
        the column
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • hasAtTopOf

        boolean hasAtTopOf​(org.refcodes.graphical.Position aPos)
                    throws java.lang.IndexOutOfBoundsException
        Checks for at top of.
        Parameters:
        aPos - the pos
        Returns:
        true, if successful
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • atTopOf

        P atTopOf​(org.refcodes.graphical.Position aPos)
           throws java.lang.IndexOutOfBoundsException
        At top of.
        Parameters:
        aPos - the pos
        Returns:
        the p
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • hasAtTopRightOf

        boolean hasAtTopRightOf​(org.refcodes.graphical.Position aPos)
                         throws java.lang.IndexOutOfBoundsException
        Checks for at top right of.
        Parameters:
        aPos - the pos
        Returns:
        true, if successful
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • atTopRightOf

        P atTopRightOf​(org.refcodes.graphical.Position aPos)
                throws java.lang.IndexOutOfBoundsException
        At top right of.
        Parameters:
        aPos - the pos
        Returns:
        the p
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • hasAtRightOf

        boolean hasAtRightOf​(org.refcodes.graphical.Position aPos)
                      throws java.lang.IndexOutOfBoundsException
        Checks for at right of.
        Parameters:
        aPos - the pos
        Returns:
        true, if successful
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • atRightOf

        P atRightOf​(org.refcodes.graphical.Position aPos)
             throws java.lang.IndexOutOfBoundsException
        At right of.
        Parameters:
        aPos - the pos
        Returns:
        the p
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • hasAtBottomRightOf

        boolean hasAtBottomRightOf​(org.refcodes.graphical.Position aPos)
                            throws java.lang.IndexOutOfBoundsException
        Checks for at bottom right of.
        Parameters:
        aPos - the pos
        Returns:
        true, if successful
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • atBottomRightOf

        P atBottomRightOf​(org.refcodes.graphical.Position aPos)
                   throws java.lang.IndexOutOfBoundsException
        At bottom right of.
        Parameters:
        aPos - the pos
        Returns:
        the p
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • hasAtBottomOf

        boolean hasAtBottomOf​(org.refcodes.graphical.Position aPos)
                       throws java.lang.IndexOutOfBoundsException
        Checks for at bottom of.
        Parameters:
        aPos - the pos
        Returns:
        true, if successful
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • atBottomOf

        P atBottomOf​(org.refcodes.graphical.Position aPos)
              throws java.lang.IndexOutOfBoundsException
        At bottom of.
        Parameters:
        aPos - the pos
        Returns:
        the p
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • hasAtBottomLeftOf

        boolean hasAtBottomLeftOf​(org.refcodes.graphical.Position aPos)
                           throws java.lang.IndexOutOfBoundsException
        Checks for at bottom left of.
        Parameters:
        aPos - the pos
        Returns:
        true, if successful
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • atBottomLeftOf

        P atBottomLeftOf​(org.refcodes.graphical.Position aPos)
                  throws java.lang.IndexOutOfBoundsException
        At bottom left of.
        Parameters:
        aPos - the pos
        Returns:
        the p
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • hasAtLeftOf

        boolean hasAtLeftOf​(org.refcodes.graphical.Position aPos)
                     throws java.lang.IndexOutOfBoundsException
        Checks for at left of.
        Parameters:
        aPos - the pos
        Returns:
        true, if successful
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • atLeftOf

        P atLeftOf​(org.refcodes.graphical.Position aPos)
            throws java.lang.IndexOutOfBoundsException
        At left of.
        Parameters:
        aPos - the pos
        Returns:
        the p
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • hasAtTopLeftOf

        boolean hasAtTopLeftOf​(org.refcodes.graphical.Position aPos)
                        throws java.lang.IndexOutOfBoundsException
        Checks for at top left of.
        Parameters:
        aPos - the pos
        Returns:
        true, if successful
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • atTopLeftOf

        P atTopLeftOf​(org.refcodes.graphical.Position aPos)
               throws java.lang.IndexOutOfBoundsException
        At top left of.
        Parameters:
        aPos - the pos
        Returns:
        the p
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • forEach

        void forEach​(java.util.function.Consumer<P> aConsumer)
        Performs the given action for each Player on the Checkerboard until all players have been processed or the action throws an exception.
        Parameters:
        aConsumer - The action to be performed for each Player.