Package org.refcodes.boulderdash
Class BoulderDashBoardImpl
- java.lang.Object
-
- org.refcodes.boulderdash.BoulderDashBoardImpl
-
- All Implemented Interfaces:
BoulderDashBoard,org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>,org.refcodes.checkerboard.Players<BoulderDashPlayer>,org.refcodes.component.Component,org.refcodes.component.Destroyable,org.refcodes.graphical.GridDimension,org.refcodes.graphical.GridDimension.GridDimensionBuilder<BoulderDashPlayer>,org.refcodes.graphical.GridDimension.GridDimensionMutator,org.refcodes.graphical.GridDimension.GridDimensionProperty,org.refcodes.graphical.GridHeightAccessor,org.refcodes.graphical.GridHeightAccessor.GridHeightBuilder<BoulderDashPlayer>,org.refcodes.graphical.GridHeightAccessor.GridHeightMutator,org.refcodes.graphical.GridHeightAccessor.GridHeightProperty,org.refcodes.graphical.GridModeAccessor,org.refcodes.graphical.GridModeAccessor.GridModeBuilder<BoulderDashPlayer>,org.refcodes.graphical.GridModeAccessor.GridModeMutator,org.refcodes.graphical.GridModeAccessor.GridModeProperty,org.refcodes.graphical.GridWidthAccessor,org.refcodes.graphical.GridWidthAccessor.GridWidthBuilder<BoulderDashPlayer>,org.refcodes.graphical.GridWidthAccessor.GridWidthMutator,org.refcodes.graphical.GridWidthAccessor.GridWidthProperty,org.refcodes.observer.Observable<BoulderDashPlayer>
- Direct Known Subclasses:
BoulderDashAutomaton
public class BoulderDashBoardImpl extends java.lang.Object implements BoulderDashBoard
-
-
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
-
-
Constructor Summary
Constructors Constructor Description BoulderDashBoardImpl(org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> aCheckerboard)Constructs aBoulderDashBoardfrom the providedCheckerboard.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BoulderDashPlayeratBottomLeftOf(org.refcodes.graphical.Position aPos)BoulderDashPlayeratBottomOf(org.refcodes.graphical.Position aPos)BoulderDashPlayeratBottomRightOf(org.refcodes.graphical.Position aPos)BoulderDashPlayeratLeftOf(org.refcodes.graphical.Position aPos)BoulderDashPlayeratPosition(int aPosX, int aPosY)BoulderDashPlayeratPosition(org.refcodes.graphical.Position aPos)BoulderDashPlayeratRightOf(org.refcodes.graphical.Position aPos)BoulderDashPlayeratTopLeftOf(org.refcodes.graphical.Position aPos)BoulderDashPlayeratTopOf(org.refcodes.graphical.Position aPos)BoulderDashPlayeratTopRightOf(org.refcodes.graphical.Position aPos)voidclearPlayers()voiddestroy()voidforEach(java.util.function.Consumer<BoulderDashPlayer> aConsumer)java.util.Map<java.lang.Integer,BoulderDashPlayer>getColumn(int aColumn)intgetGridHeight()org.refcodes.graphical.GridModegetGridMode()intgetGridWidth()java.util.List<BoulderDashPlayer>getPlayers()java.util.Map<java.lang.Integer,BoulderDashPlayer>getRow(int aRow)booleanhasAtBottomLeftOf(org.refcodes.graphical.Position aPos)booleanhasAtBottomOf(org.refcodes.graphical.Position aPos)booleanhasAtBottomRightOf(org.refcodes.graphical.Position aPos)booleanhasAtLeftOf(org.refcodes.graphical.Position aPos)booleanhasAtPosition(int aPosX, int aPosY)booleanhasAtPosition(org.refcodes.graphical.Position aPos)booleanhasAtRightOf(org.refcodes.graphical.Position aPos)booleanhasAtTopLeftOf(org.refcodes.graphical.Position aPos)booleanhasAtTopOf(org.refcodes.graphical.Position aPos)booleanhasAtTopRightOf(org.refcodes.graphical.Position aPos)booleanhasObserverSubscription(org.refcodes.checkerboard.CheckerboardObserver<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> arg0)booleanhasPlayer(BoulderDashPlayer aElement)booleanhasPlayers()intplayerCount()java.util.Iterator<BoulderDashPlayer>players()BoulderDashPlayerputPlayer(BoulderDashPlayer aElement)booleanremovePlayer(BoulderDashPlayer aElement)voidsetGridDimension(int aWidth, int aHeight)voidsetGridDimension(org.refcodes.graphical.Dimension aDimension)voidsetGridDimension(org.refcodes.graphical.GridDimension aDimension)voidsetGridHeight(int aHeight)voidsetGridMode(org.refcodes.graphical.GridMode aGridMode)voidsetGridWidth(int aWidth)booleansubscribeObserver(org.refcodes.checkerboard.CheckerboardObserver<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> arg0)booleanunsubscribeObserver(org.refcodes.checkerboard.CheckerboardObserver<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> arg0)org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>withGridDimension(int aGridWidth, int aGridHeight)org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>withGridDimension(org.refcodes.graphical.Dimension aDimension)org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>withGridDimension(org.refcodes.graphical.GridDimension aDimension)org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>withGridHeight(int aHeight)org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>withGridMode(org.refcodes.graphical.GridMode aGridMode)org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>withGridWidth(int aWidth)
-
-
-
Constructor Detail
-
BoulderDashBoardImpl
public BoulderDashBoardImpl(org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> aCheckerboard)
Constructs aBoulderDashBoardfrom the providedCheckerboard.- Parameters:
aCheckerboard- TheCheckerboardwhich to by theBoulderDashBoard.
-
-
Method Detail
-
forEach
public void forEach(java.util.function.Consumer<BoulderDashPlayer> aConsumer)
- Specified by:
forEachin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>
-
hasAtPosition
public boolean hasAtPosition(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException- Specified by:
hasAtPositionin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
hasAtPosition
public boolean hasAtPosition(int aPosX, int aPosY) throws java.lang.IndexOutOfBoundsException- Specified by:
hasAtPositionin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
getPlayers
public java.util.List<BoulderDashPlayer> getPlayers()
- Specified by:
getPlayersin interfaceorg.refcodes.checkerboard.Players<BoulderDashPlayer>
-
atPosition
public BoulderDashPlayer atPosition(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException
- Specified by:
atPositionin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
getGridMode
public org.refcodes.graphical.GridMode getGridMode()
- Specified by:
getGridModein interfaceorg.refcodes.graphical.GridModeAccessor
-
getGridWidth
public int getGridWidth()
- Specified by:
getGridWidthin interfaceorg.refcodes.graphical.GridWidthAccessor
-
getGridHeight
public int getGridHeight()
- Specified by:
getGridHeightin interfaceorg.refcodes.graphical.GridHeightAccessor
-
atPosition
public BoulderDashPlayer atPosition(int aPosX, int aPosY) throws java.lang.IndexOutOfBoundsException
- Specified by:
atPositionin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
getRow
public java.util.Map<java.lang.Integer,BoulderDashPlayer> getRow(int aRow) throws java.lang.IndexOutOfBoundsException
- Specified by:
getRowin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
getColumn
public java.util.Map<java.lang.Integer,BoulderDashPlayer> getColumn(int aColumn) throws java.lang.IndexOutOfBoundsException
- Specified by:
getColumnin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
clearPlayers
public void clearPlayers()
- Specified by:
clearPlayersin interfaceorg.refcodes.checkerboard.Players<BoulderDashPlayer>
-
atTopOf
public BoulderDashPlayer atTopOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException
- Specified by:
atTopOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
atTopRightOf
public BoulderDashPlayer atTopRightOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException
- Specified by:
atTopRightOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
hasAtRightOf
public boolean hasAtRightOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException- Specified by:
hasAtRightOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
atRightOf
public BoulderDashPlayer atRightOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException
- Specified by:
atRightOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
hasAtBottomRightOf
public boolean hasAtBottomRightOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException- Specified by:
hasAtBottomRightOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
atBottomRightOf
public BoulderDashPlayer atBottomRightOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException
- Specified by:
atBottomRightOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
hasAtBottomOf
public boolean hasAtBottomOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException- Specified by:
hasAtBottomOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
atBottomOf
public BoulderDashPlayer atBottomOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException
- Specified by:
atBottomOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
hasAtBottomLeftOf
public boolean hasAtBottomLeftOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException- Specified by:
hasAtBottomLeftOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
atBottomLeftOf
public BoulderDashPlayer atBottomLeftOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException
- Specified by:
atBottomLeftOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
hasAtLeftOf
public boolean hasAtLeftOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException- Specified by:
hasAtLeftOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
atLeftOf
public BoulderDashPlayer atLeftOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException
- Specified by:
atLeftOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
atTopLeftOf
public BoulderDashPlayer atTopLeftOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException
- Specified by:
atTopLeftOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.refcodes.component.Destroyable
-
setGridDimension
public void setGridDimension(int aWidth, int aHeight)- Specified by:
setGridDimensionin interfaceorg.refcodes.graphical.GridDimension.GridDimensionMutator
-
setGridMode
public void setGridMode(org.refcodes.graphical.GridMode aGridMode)
- Specified by:
setGridModein interfaceorg.refcodes.graphical.GridModeAccessor.GridModeMutator
-
setGridWidth
public void setGridWidth(int aWidth)
- Specified by:
setGridWidthin interfaceorg.refcodes.graphical.GridWidthAccessor.GridWidthMutator
-
setGridHeight
public void setGridHeight(int aHeight)
- Specified by:
setGridHeightin interfaceorg.refcodes.graphical.GridHeightAccessor.GridHeightMutator
-
setGridDimension
public void setGridDimension(org.refcodes.graphical.GridDimension aDimension)
- Specified by:
setGridDimensionin interfaceorg.refcodes.graphical.GridDimension.GridDimensionMutator
-
players
public java.util.Iterator<BoulderDashPlayer> players()
- Specified by:
playersin interfaceorg.refcodes.checkerboard.Players<BoulderDashPlayer>
-
hasPlayer
public boolean hasPlayer(BoulderDashPlayer aElement)
- Specified by:
hasPlayerin interfaceorg.refcodes.checkerboard.Players<BoulderDashPlayer>
-
setGridDimension
public void setGridDimension(org.refcodes.graphical.Dimension aDimension)
- Specified by:
setGridDimensionin interfaceorg.refcodes.graphical.GridDimension.GridDimensionMutator
-
playerCount
public int playerCount()
- Specified by:
playerCountin interfaceorg.refcodes.checkerboard.Players<BoulderDashPlayer>
-
hasPlayers
public boolean hasPlayers()
- Specified by:
hasPlayersin interfaceorg.refcodes.checkerboard.Players<BoulderDashPlayer>
-
withGridWidth
public org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> withGridWidth(int aWidth)
- Specified by:
withGridWidthin interfaceorg.refcodes.graphical.GridWidthAccessor.GridWidthBuilder<BoulderDashPlayer>
-
withGridMode
public org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> withGridMode(org.refcodes.graphical.GridMode aGridMode)
- Specified by:
withGridModein interfaceorg.refcodes.graphical.GridModeAccessor.GridModeBuilder<BoulderDashPlayer>
-
withGridHeight
public org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> withGridHeight(int aHeight)
- Specified by:
withGridHeightin interfaceorg.refcodes.graphical.GridHeightAccessor.GridHeightBuilder<BoulderDashPlayer>
-
putPlayer
public BoulderDashPlayer putPlayer(BoulderDashPlayer aElement)
- Specified by:
putPlayerin interfaceorg.refcodes.checkerboard.Players<BoulderDashPlayer>
-
withGridDimension
public org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> withGridDimension(int aGridWidth, int aGridHeight)
- Specified by:
withGridDimensionin interfaceorg.refcodes.graphical.GridDimension.GridDimensionBuilder<BoulderDashPlayer>
-
hasAtTopOf
public boolean hasAtTopOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException- Specified by:
hasAtTopOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
removePlayer
public boolean removePlayer(BoulderDashPlayer aElement)
- Specified by:
removePlayerin interfaceorg.refcodes.checkerboard.Players<BoulderDashPlayer>
-
withGridDimension
public org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> withGridDimension(org.refcodes.graphical.GridDimension aDimension)
- Specified by:
withGridDimensionin interfaceorg.refcodes.graphical.GridDimension.GridDimensionBuilder<BoulderDashPlayer>
-
withGridDimension
public org.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> withGridDimension(org.refcodes.graphical.Dimension aDimension)
- Specified by:
withGridDimensionin interfaceorg.refcodes.graphical.GridDimension.GridDimensionBuilder<BoulderDashPlayer>
-
hasAtTopRightOf
public boolean hasAtTopRightOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException- Specified by:
hasAtTopRightOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
hasAtTopLeftOf
public boolean hasAtTopLeftOf(org.refcodes.graphical.Position aPos) throws java.lang.IndexOutOfBoundsException- Specified by:
hasAtTopLeftOfin interfaceorg.refcodes.checkerboard.Checkerboard<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus>- Throws:
java.lang.IndexOutOfBoundsException
-
hasObserverSubscription
public boolean hasObserverSubscription(org.refcodes.checkerboard.CheckerboardObserver<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> arg0)
- Specified by:
hasObserverSubscriptionin interfaceorg.refcodes.observer.Observable<BoulderDashPlayer>
-
subscribeObserver
public boolean subscribeObserver(org.refcodes.checkerboard.CheckerboardObserver<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> arg0)
- Specified by:
subscribeObserverin interfaceorg.refcodes.observer.Observable<BoulderDashPlayer>
-
unsubscribeObserver
public boolean unsubscribeObserver(org.refcodes.checkerboard.CheckerboardObserver<BoulderDashPlayer,org.refcodes.data.ext.boulderdash.BoulderDashStatus> arg0)
- Specified by:
unsubscribeObserverin interfaceorg.refcodes.observer.Observable<BoulderDashPlayer>
-
-