public class CheckerboardImpl<S> extends AbstractObservable<CheckerboardObserver<S>,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> |
atPosition(int aPosX,
int aPosY) |
Player<S> |
atPosition(org.refcodes.graphical.Position aPos) |
void |
clearPlayers() |
void |
destroy() |
protected boolean |
fireEvent(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 |
hasAtPosition(int aPosX,
int aPosY) |
boolean |
hasAtPosition(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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasObserverSubscription
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 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 Observable<CheckerboardObserver<S>>
subscribeObserver
in class AbstractObservable<CheckerboardObserver<S>,Event<?>>
public boolean unsubscribeObserver(CheckerboardObserver<S> aObserver)
unsubscribeObserver
in interface Observable<CheckerboardObserver<S>>
unsubscribeObserver
in class AbstractObservable<CheckerboardObserver<S>,Event<?>>
public void destroy()
destroy
in interface org.refcodes.component.Destroyable
protected boolean fireEvent(Event<?> aEvent, CheckerboardObserver<S> aObserver, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) throws org.refcodes.exception.VetoException
fireEvent
in class AbstractObservable<CheckerboardObserver<S>,Event<?>>
org.refcodes.exception.VetoException
Copyright © 2015. All rights reserved.