public class CheckerboardImpl<S> extends org.refcodes.observer.impls.AbstractObservable<CheckerboardObserver<S>,org.refcodes.observer.Event<?>> implements Checkerboard<S>
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
org.refcodes.graphical.GridWidthAccessor.GridWidthBuilder<B extends org.refcodes.graphical.GridWidthAccessor.GridWidthBuilder<B>>, org.refcodes.graphical.GridWidthAccessor.GridWidthMutator, org.refcodes.graphical.GridWidthAccessor.GridWidthProperty
org.refcodes.graphical.GridHeightAccessor.GridHeightBuilder<B extends org.refcodes.graphical.GridHeightAccessor.GridHeightBuilder<B>>, org.refcodes.graphical.GridHeightAccessor.GridHeightMutator, org.refcodes.graphical.GridHeightAccessor.GridHeightProperty
org.refcodes.graphical.GridModeAccessor.GridModeBuilder<B extends org.refcodes.graphical.GridModeAccessor.GridModeBuilder<B>>, org.refcodes.graphical.GridModeAccessor.GridModeMutator, org.refcodes.graphical.GridModeAccessor.GridModeProperty
Constructor and Description |
---|
CheckerboardImpl() |
Modifier and Type | Method and Description |
---|---|
Player<S> |
atBottomLeftOf(org.refcodes.graphical.Position aPos) |
Player<S> |
atBottomOf(org.refcodes.graphical.Position aPos) |
Player<S> |
atBottomRightOf(org.refcodes.graphical.Position aPos) |
Player<S> |
atLeftOf(org.refcodes.graphical.Position aPos) |
Player<S> |
atPosition(int aPosX,
int aPosY) |
Player<S> |
atPosition(org.refcodes.graphical.Position aPos) |
Player<S> |
atRightOf(org.refcodes.graphical.Position aPos) |
Player<S> |
atTopLeftOf(org.refcodes.graphical.Position aPos) |
Player<S> |
atTopOf(org.refcodes.graphical.Position aPos) |
Player<S> |
atTopRightOf(org.refcodes.graphical.Position aPos) |
void |
clearPlayers() |
void |
destroy() |
protected boolean |
fireEvent(org.refcodes.observer.Event<?> aEvent,
CheckerboardObserver<S> aObserver,
org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) |
Map<Integer,Player<S>> |
getColumn(int aColumn) |
int |
getGridHeight() |
org.refcodes.graphical.GridMode |
getGridMode() |
int |
getGridWidth() |
List<Player<S>> |
getPlayers() |
Map<Integer,Player<S>> |
getRow(int aRow) |
boolean |
hasAtBottomLeftOf(org.refcodes.graphical.Position aPos) |
boolean |
hasAtBottomOf(org.refcodes.graphical.Position aPos) |
boolean |
hasAtBottomRightOf(org.refcodes.graphical.Position aPos) |
boolean |
hasAtLeftOf(org.refcodes.graphical.Position aPos) |
boolean |
hasAtPosition(int aPosX,
int aPosY) |
boolean |
hasAtPosition(org.refcodes.graphical.Position aPos) |
boolean |
hasAtRightOf(org.refcodes.graphical.Position aPos) |
boolean |
hasAtTopLeftOf(org.refcodes.graphical.Position aPos) |
boolean |
hasAtTopOf(org.refcodes.graphical.Position aPos) |
boolean |
hasAtTopRightOf(org.refcodes.graphical.Position aPos) |
boolean |
hasPlayer(Player<S> aPlayer) |
boolean |
hasPlayers() |
int |
playerCount() |
Iterator<Player<S>> |
players() |
Player<S> |
putPlayer(Player<S> aPlayer) |
boolean |
removePlayer(Player<S> aPlayer) |
void |
setGridDimension(org.refcodes.graphical.Dimension aDimension) |
void |
setGridDimension(org.refcodes.graphical.GridDimension aDimension) |
void |
setGridDimension(int aWidth,
int aHeight) |
void |
setGridHeight(int aHeight) |
void |
setGridMode(org.refcodes.graphical.GridMode aGridMode) |
void |
setGridWidth(int aWidth) |
boolean |
subscribeObserver(CheckerboardObserver<S> aObserver) |
boolean |
unsubscribeObserver(CheckerboardObserver<S> aObserver) |
Checkerboard<S> |
withGridDimension(org.refcodes.graphical.Dimension aDimension) |
Checkerboard<S> |
withGridDimension(org.refcodes.graphical.GridDimension aDimension) |
Checkerboard<S> |
withGridDimension(int aGridWidth,
int aGridHeight) |
Checkerboard<S> |
withGridHeight(int aHeight) |
Checkerboard<S> |
withGridMode(org.refcodes.graphical.GridMode aGridMode) |
Checkerboard<S> |
withGridWidth(int aWidth) |
clear, dispose, doHandleEventListenerException, fireEvent, getThreadPriority, hasObserverSubscription, isEmpty, setThreadPriority, size
public Checkerboard<S> withGridMode(org.refcodes.graphical.GridMode aGridMode)
withGridMode
in interface org.refcodes.graphical.GridModeAccessor.GridModeBuilder<Checkerboard<S>>
public Checkerboard<S> withGridDimension(int aGridWidth, int aGridHeight)
withGridDimension
in interface org.refcodes.graphical.GridDimension.GridDimensionBuilder<Checkerboard<S>>
public Checkerboard<S> withGridDimension(org.refcodes.graphical.GridDimension aDimension)
withGridDimension
in interface org.refcodes.graphical.GridDimension.GridDimensionBuilder<Checkerboard<S>>
public Checkerboard<S> withGridDimension(org.refcodes.graphical.Dimension aDimension)
withGridDimension
in interface org.refcodes.graphical.GridDimension.GridDimensionBuilder<Checkerboard<S>>
public Checkerboard<S> withGridWidth(int aWidth)
withGridWidth
in interface org.refcodes.graphical.GridWidthAccessor.GridWidthBuilder<Checkerboard<S>>
public Checkerboard<S> withGridHeight(int aHeight)
withGridHeight
in interface org.refcodes.graphical.GridHeightAccessor.GridHeightBuilder<Checkerboard<S>>
public boolean hasAtPosition(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
hasAtPosition
in interface Checkerboard<S>
IndexOutOfBoundsException
public boolean hasAtPosition(int aPosX, int aPosY) throws IndexOutOfBoundsException
hasAtPosition
in interface Checkerboard<S>
IndexOutOfBoundsException
public Player<S> atPosition(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
atPosition
in interface Checkerboard<S>
IndexOutOfBoundsException
public Player<S> atPosition(int aPosX, int aPosY) throws IndexOutOfBoundsException
atPosition
in interface Checkerboard<S>
IndexOutOfBoundsException
public boolean hasAtTopOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
hasAtTopOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public Player<S> atTopOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
atTopOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public boolean hasAtTopRightOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
hasAtTopRightOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public Player<S> atTopRightOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
atTopRightOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public boolean hasAtRightOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
hasAtRightOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public Player<S> atRightOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
atRightOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public boolean hasAtBottomRightOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
hasAtBottomRightOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public Player<S> atBottomRightOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
atBottomRightOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public boolean hasAtBottomOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
hasAtBottomOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public Player<S> atBottomOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
atBottomOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public boolean hasAtBottomLeftOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
hasAtBottomLeftOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public Player<S> atBottomLeftOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
atBottomLeftOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public boolean hasAtLeftOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
hasAtLeftOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public Player<S> atLeftOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
atLeftOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public boolean hasAtTopLeftOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
hasAtTopLeftOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public Player<S> atTopLeftOf(org.refcodes.graphical.Position aPos) throws IndexOutOfBoundsException
atTopLeftOf
in interface Checkerboard<S>
IndexOutOfBoundsException
public Map<Integer,Player<S>> getRow(int aRow) throws IndexOutOfBoundsException
getRow
in interface Checkerboard<S>
IndexOutOfBoundsException
public Map<Integer,Player<S>> getColumn(int aColumn) throws IndexOutOfBoundsException
getColumn
in interface Checkerboard<S>
IndexOutOfBoundsException
public org.refcodes.graphical.GridMode getGridMode()
getGridMode
in interface org.refcodes.graphical.GridModeAccessor
public void setGridMode(org.refcodes.graphical.GridMode aGridMode)
setGridMode
in interface org.refcodes.graphical.GridModeAccessor.GridModeMutator
public boolean removePlayer(Player<S> aPlayer)
removePlayer
in interface Players<S>
public void clearPlayers()
clearPlayers
in interface Players<S>
public int playerCount()
playerCount
in interface Players<S>
public boolean hasPlayers()
hasPlayers
in interface Players<S>
public int getGridWidth()
getGridWidth
in interface org.refcodes.graphical.GridWidthAccessor
public void setGridDimension(int aWidth, int aHeight)
setGridDimension
in interface org.refcodes.graphical.GridDimension.GridDimensionMutator
public void setGridDimension(org.refcodes.graphical.GridDimension aDimension)
setGridDimension
in interface org.refcodes.graphical.GridDimension.GridDimensionMutator
public void setGridDimension(org.refcodes.graphical.Dimension aDimension)
setGridDimension
in interface org.refcodes.graphical.GridDimension.GridDimensionMutator
public void setGridWidth(int aWidth)
setGridWidth
in interface org.refcodes.graphical.GridWidthAccessor.GridWidthMutator
public void setGridHeight(int aHeight)
setGridHeight
in interface org.refcodes.graphical.GridHeightAccessor.GridHeightMutator
public int getGridHeight()
getGridHeight
in interface org.refcodes.graphical.GridHeightAccessor
public boolean subscribeObserver(CheckerboardObserver<S> aObserver)
subscribeObserver
in interface org.refcodes.observer.Observable<CheckerboardObserver<S>>
subscribeObserver
in class org.refcodes.observer.impls.AbstractObservable<CheckerboardObserver<S>,org.refcodes.observer.Event<?>>
public boolean unsubscribeObserver(CheckerboardObserver<S> aObserver)
unsubscribeObserver
in interface org.refcodes.observer.Observable<CheckerboardObserver<S>>
unsubscribeObserver
in class org.refcodes.observer.impls.AbstractObservable<CheckerboardObserver<S>,org.refcodes.observer.Event<?>>
public void destroy()
destroy
in interface org.refcodes.component.Destroyable
protected boolean fireEvent(org.refcodes.observer.Event<?> aEvent, CheckerboardObserver<S> aObserver, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) throws org.refcodes.exception.VetoException
fireEvent
in class org.refcodes.observer.impls.AbstractObservable<CheckerboardObserver<S>,org.refcodes.observer.Event<?>>
org.refcodes.exception.VetoException
Copyright © 2017. All rights reserved.