Module org.refcodes.checkerboard
Package org.refcodes.checkerboard
Class ConsoleCheckerboardViewerImpl<P extends Player<P,S>,S>
java.lang.Object
org.refcodes.checkerboard.AbstractCheckerboardViewer<P,S,String,ConsoleSpriteFactory<S>,ConsoleCheckerboardViewer<P,S>>
org.refcodes.checkerboard.ConsoleCheckerboardViewerImpl<P,S>
- Type Parameters:
P
- the generic type of thePlayer
S
- The type which's instances represent aPlayer
state.
- All Implemented Interfaces:
CheckerboardObserver<P,S>
,CheckerboardViewer<P,S,ConsoleCheckerboardViewer<P,S>>
,ConsoleCheckerboardViewer<P,S>
,org.refcodes.component.Component
,org.refcodes.component.Destroyable
,org.refcodes.component.Initializable
,org.refcodes.component.Initializable.InitializeBuilder<ConsoleCheckerboardViewer<P,S>>
,org.refcodes.component.InitializableComponent
,org.refcodes.graphical.GridDimension
,org.refcodes.graphical.GridHeightAccessor
,org.refcodes.graphical.GridModeAccessor
,org.refcodes.graphical.GridWidthAccessor
,org.refcodes.graphical.MinViewportDimension
,org.refcodes.graphical.MinViewportDimension.MinViewportDimensionBuilder<ConsoleCheckerboardViewer<P,S>>
,org.refcodes.graphical.MinViewportDimension.MinViewportDimensionMutator
,org.refcodes.graphical.MinViewportDimension.MinViewportDimensionProperty
,org.refcodes.graphical.ViewportDimension
,org.refcodes.graphical.ViewportDimension.ViewportDimensionBuilder<ConsoleCheckerboardViewer<P,S>>
,org.refcodes.graphical.ViewportDimension.ViewportDimensionMutator
,org.refcodes.graphical.ViewportDimension.ViewportDimensionProperty
,org.refcodes.graphical.ViewportHeightAccessor
,org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightBuilder<ConsoleCheckerboardViewer<P,S>>
,org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightMutator
,org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightProperty
,org.refcodes.graphical.ViewportOffset
,org.refcodes.graphical.ViewportOffset.ViewportOffsetBuilder<ConsoleCheckerboardViewer<P,S>>
,org.refcodes.graphical.ViewportOffset.ViewportOffsetMutator
,org.refcodes.graphical.ViewportOffset.ViewportOffsetProperty
,org.refcodes.graphical.ViewportOffsetXAccessor
,org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXBuilder<ConsoleCheckerboardViewer<P,S>>
,org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXMutator
,org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXProperty
,org.refcodes.graphical.ViewportOffsetYAccessor
,org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYBuilder<ConsoleCheckerboardViewer<P,S>>
,org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYMutator
,org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYProperty
,org.refcodes.graphical.ViewportWidthAccessor
,org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthBuilder<ConsoleCheckerboardViewer<P,S>>
,org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthMutator
,org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthProperty
,org.refcodes.mixin.ColumnWidthAccessor
,org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<ConsoleCheckerboardViewer<P,S>>
,org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
,org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
,org.refcodes.observer.ObservableObserver<Checkerboard<P,S>>
public class ConsoleCheckerboardViewerImpl<P extends Player<P,S>,S> extends AbstractCheckerboardViewer<P,S,String,ConsoleSpriteFactory<S>,ConsoleCheckerboardViewer<P,S>> implements ConsoleCheckerboardViewer<P,S>
Most basic implementation of the
CheckerboardViewer
interface
printing the current checkerboard as good as it gets. Call
initialize()
when everything is setup correctly. When a redraw time
<= 0 is set upon construction, then the Checkerboard
is printed
out upon any according events from the underlying Checkerboard
or, in
case the refresh time is > 0 the Checkerboard
is redrawn as of the
refresh loop time. Attention: The Checkerboard
is only redrawn in
case the Checkerboard
changed compared to the last redraw process.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.ColumnWidthAccessor
org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B extends org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthBuilder<B>>, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator, org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
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
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
Nested classes/interfaces inherited from interface org.refcodes.component.Initializable
org.refcodes.component.Initializable.InitializeAutomaton, org.refcodes.component.Initializable.InitializeBuilder<B extends org.refcodes.component.Initializable.InitializeBuilder<B>>, org.refcodes.component.Initializable.UncheckedInitializable
Nested classes/interfaces inherited from interface org.refcodes.graphical.MinViewportDimension
org.refcodes.graphical.MinViewportDimension.MinViewportDimensionBuilder<B extends org.refcodes.graphical.MinViewportDimension.MinViewportDimensionBuilder<B>>, org.refcodes.graphical.MinViewportDimension.MinViewportDimensionMutator, org.refcodes.graphical.MinViewportDimension.MinViewportDimensionProperty
Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportDimension
org.refcodes.graphical.ViewportDimension.ViewportDimensionBuilder<B extends org.refcodes.graphical.ViewportDimension.ViewportDimensionBuilder<B>>, org.refcodes.graphical.ViewportDimension.ViewportDimensionMutator, org.refcodes.graphical.ViewportDimension.ViewportDimensionProperty
Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportHeightAccessor
org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightBuilder<B extends org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightBuilder<B>>, org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightMutator, org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightProperty
Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportOffset
org.refcodes.graphical.ViewportOffset.ViewportOffsetBuilder<B extends org.refcodes.graphical.ViewportOffset.ViewportOffsetBuilder<B>>, org.refcodes.graphical.ViewportOffset.ViewportOffsetMutator, org.refcodes.graphical.ViewportOffset.ViewportOffsetProperty
Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportOffsetXAccessor
org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXBuilder<B extends org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXBuilder<B>>, org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXMutator, org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXProperty
Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportOffsetYAccessor
org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYBuilder<B extends org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYBuilder<B>>, org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYMutator, org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYProperty
Nested classes/interfaces inherited from interface org.refcodes.graphical.ViewportWidthAccessor
org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthBuilder<B extends org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthBuilder<B>>, org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthMutator, org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthProperty
-
Constructor Summary
Constructors Constructor Description ConsoleCheckerboardViewerImpl(Checkerboard<P,S> aCheckerboard, ConsoleSpriteFactory<S> aSpriteFactory)
Constructs theConsoleCheckerboardViewer
with the providedSpriteFactory
creating "Sprites" (in this caseString
instances) for visualizing the playground's state.ConsoleCheckerboardViewerImpl(Checkerboard<P,S> aCheckerboard, ConsoleSpriteFactory<S> aSpriteFactory, int aRedrawLoopTimeInMillis)
Constructs theConsoleCheckerboardViewer
with the providedSpriteFactory
creating "Sprites" (in this caseString
instances) for visualizing the playground's state.ConsoleCheckerboardViewerImpl(Checkerboard<P,S> aCheckerboard, ConsoleSpriteFactory<S> aSpriteFactory, int aColumnWidth, int aRedrawLoopTimeInMillis)
Constructs theConsoleCheckerboardViewer
with the providedSpriteFactory
creating "Sprites" (in this caseString
instances) for visualizing the playground's state. -
Method Summary
Modifier and Type Method Description int
getColumnWidth()
int
getRedrawLoopTimeInMillis()
Retrieves the refresh loop time between two redraw cycles of theCheckerboard
.void
initialize()
boolean
isRedrawOnEvent()
Determines whether theCheckerboard
is printed out upon any according events from the underlyingCheckerboard
or as of the refresh loop time (seeConsoleCheckerboardViewer.getRedrawLoopTimeInMillis()
).void
onChangePositionEvent(ChangePositionEvent<P> aPlayerEvent, Checkerboard<P,S> aSource)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onCheckerboardEvent(CheckerboardEvent<P,S> aCheckerboardEvent)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onDraggabilityChangedEvent(DraggabilityChangedEvent<P> aPlayerEvent, Checkerboard<P,S> aSource)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.protected void
onEventPrintPlayground()
Prints the playground upon an accordingCheckerboard
event in case thevoid
onGridDimensionChangedEvent(GridDimensionChangedEvent<P,S> aCheckerboardEvent)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onGridModeChangedEvent(GridModeChangedEvent<P,S> aCheckerboardEvent)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onPlayerAddedEvent(PlayerAddedEvent<P,S> aCheckerboardEvent)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onPlayerEvent(PlayerEvent<P> aPlayerEvent, Checkerboard<P,S> aSource)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onPlayerRemovedEvent(PlayerRemovedEvent<P,S> aCheckerboardEvent)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onPositionChangedEvent(PositionChangedEvent<P> aPlayerEvent, Checkerboard<P,S> aSource)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onStateChangedEvent(StateChangedEvent<P,S> aPlayerEvent, Checkerboard<P,S> aSource)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onViewportDimensionChangedEvent(ViewportDimensionChangedEvent<P,S> aCheckerboardEvent)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onViewportOffsetChangedEvent(ViewportOffsetChangedEvent<P,S> aCheckerboardEvent)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.void
onVisibilityChangedEvent(VisibilityChangedEvent<P> aPlayerEvent, Checkerboard<P,S> aSource)
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.protected void
printPlaygroundDaemon()
Loops the playground printing viaprintPlayground()
.void
setColumnWidth(int aColumnWidth)
Methods inherited from class org.refcodes.checkerboard.AbstractCheckerboardViewer
destroy, getCheckerboard, getGridHeight, getGridMode, getGridWidth, getMinViewportDimension, getViewportHeight, getViewportOffsetX, getViewportOffsetY, getViewportWidth, onSubscribe, onUnsubscribe, setMinViewportDimension, setMinViewportDimension, setMinViewportDimension, setViewportDimension, setViewportDimension, setViewportDimension, setViewportHeight, setViewportOffset, setViewportOffset, setViewportOffset, setViewportOffset, setViewportOffsetX, setViewportOffsetY, setViewportWidth, withInitialize, withMinViewportDimension, withMinViewportDimension, withMinViewportDimension, withViewportDimension, withViewportDimension, withViewportDimension, withViewportHeight, withViewportOffset, withViewportOffset, withViewportOffset, withViewportOffset, withViewportOffsetX, withViewportOffsetY, withViewportWidth
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.mixin.ColumnWidthAccessor.ColumnWidthProperty
letColumnWidth
Methods inherited from interface org.refcodes.checkerboard.ConsoleCheckerboardViewer
withColumnWidth
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.GridHeightAccessor
getGridHeight
Methods inherited from interface org.refcodes.graphical.GridModeAccessor
getGridMode
Methods inherited from interface org.refcodes.graphical.GridWidthAccessor
getGridWidth
Methods inherited from interface org.refcodes.component.Initializable
initializeUnchecked
Methods inherited from interface org.refcodes.component.Initializable.InitializeBuilder
withInitialize, withInitializeUnchecked
Methods inherited from interface org.refcodes.graphical.MinViewportDimension
getMinViewportDimension
Methods inherited from interface org.refcodes.graphical.MinViewportDimension.MinViewportDimensionBuilder
withMinViewportDimension, withMinViewportDimension, withMinViewportDimension
Methods inherited from interface org.refcodes.graphical.MinViewportDimension.MinViewportDimensionMutator
setMinViewportDimension, setMinViewportDimension, setMinViewportDimension
Methods inherited from interface org.refcodes.graphical.MinViewportDimension.MinViewportDimensionProperty
letMinViewportDimension, letMinViewportDimension, letMinViewportDimension
Methods inherited from interface org.refcodes.observer.ObservableObserver
onSubscribe, onUnsubscribe
Methods inherited from interface org.refcodes.graphical.ViewportDimension.ViewportDimensionBuilder
withViewportDimension, withViewportDimension, withViewportDimension
Methods inherited from interface org.refcodes.graphical.ViewportDimension.ViewportDimensionMutator
setViewportDimension, setViewportDimension, setViewportDimension
Methods inherited from interface org.refcodes.graphical.ViewportHeightAccessor
getViewportHeight
Methods inherited from interface org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightBuilder
withViewportHeight
Methods inherited from interface org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightMutator
setViewportHeight
Methods inherited from interface org.refcodes.graphical.ViewportHeightAccessor.ViewportHeightProperty
letViewportHeight
Methods inherited from interface org.refcodes.graphical.ViewportOffset.ViewportOffsetBuilder
withViewportOffset, withViewportOffset, withViewportOffset, withViewportOffset
Methods inherited from interface org.refcodes.graphical.ViewportOffset.ViewportOffsetMutator
setViewportOffset, setViewportOffset, setViewportOffset, setViewportOffset
Methods inherited from interface org.refcodes.graphical.ViewportOffsetXAccessor
getViewportOffsetX
Methods inherited from interface org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXBuilder
withViewportOffsetX
Methods inherited from interface org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXMutator
setViewportOffsetX
Methods inherited from interface org.refcodes.graphical.ViewportOffsetXAccessor.ViewportOffsetXProperty
letViewportOffsetX
Methods inherited from interface org.refcodes.graphical.ViewportOffsetYAccessor
getViewportOffsetY
Methods inherited from interface org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYBuilder
withViewportOffsetY
Methods inherited from interface org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYMutator
setViewportOffsetY
Methods inherited from interface org.refcodes.graphical.ViewportOffsetYAccessor.ViewportOffsetYProperty
letViewportOffsetY
Methods inherited from interface org.refcodes.graphical.ViewportWidthAccessor
getViewportWidth
Methods inherited from interface org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthBuilder
withViewportWidth
Methods inherited from interface org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthMutator
setViewportWidth
Methods inherited from interface org.refcodes.graphical.ViewportWidthAccessor.ViewportWidthProperty
letViewportWidth
-
Constructor Details
-
ConsoleCheckerboardViewerImpl
public ConsoleCheckerboardViewerImpl(Checkerboard<P,S> aCheckerboard, ConsoleSpriteFactory<S> aSpriteFactory)Constructs theConsoleCheckerboardViewer
with the providedSpriteFactory
creating "Sprites" (in this caseString
instances) for visualizing the playground's state. TheConsoleCheckerboardViewer
is initialized with a redraw loop time of 100 ms. Attention: TheCheckerboard
is only redrawn in case theCheckerboard
changed compared to the last redraw process.- Parameters:
aCheckerboard
- TheCheckerboard
for which to construct the viewer.aSpriteFactory
- TheSpriteFactory
to be used.
-
ConsoleCheckerboardViewerImpl
public ConsoleCheckerboardViewerImpl(Checkerboard<P,S> aCheckerboard, ConsoleSpriteFactory<S> aSpriteFactory, int aRedrawLoopTimeInMillis)Constructs theConsoleCheckerboardViewer
with the providedSpriteFactory
creating "Sprites" (in this caseString
instances) for visualizing the playground's state. TheConsoleCheckerboardViewer
is initialized with the according redraw loop time. When a redraw time <= 0 is set upon construction, then theCheckerboard
is printed out upon any according events from the underlyingCheckerboard
or, in case the refresh time is > 0 theCheckerboard
is redrawn as of the refresh loop time. Attention: TheCheckerboard
is only redrawn in case theCheckerboard
changed compared to the last redraw process. A default column width of 3 is configured.- Parameters:
aRedrawLoopTimeInMillis
- The redraw loop time to work with.aCheckerboard
- TheCheckerboard
for which to construct the viewer.aSpriteFactory
- TheSpriteFactory
to be used.
-
ConsoleCheckerboardViewerImpl
public ConsoleCheckerboardViewerImpl(Checkerboard<P,S> aCheckerboard, ConsoleSpriteFactory<S> aSpriteFactory, int aColumnWidth, int aRedrawLoopTimeInMillis)Constructs theConsoleCheckerboardViewer
with the providedSpriteFactory
creating "Sprites" (in this caseString
instances) for visualizing the playground's state. TheConsoleCheckerboardViewer
is initialized with the according redraw loop time. When a redraw time <= 0 is set upon construction, then theCheckerboard
is printed out upon any according events from the underlyingCheckerboard
or, in case the refresh time is > 0 theCheckerboard
is redrawn as of the refresh loop time. Attention: TheCheckerboard
is only redrawn in case theCheckerboard
changed compared to the last redraw process.- Parameters:
aRedrawLoopTimeInMillis
- The redraw loop time to work with.aCheckerboard
- TheCheckerboard
for which to construct the viewer.aColumnWidth
- The column width to be used when drawing theCheckerboard
table.aSpriteFactory
- TheSpriteFactory
to be used.
-
-
Method Details
-
initialize
public void initialize() throws org.refcodes.component.InitializeException- Specified by:
initialize
in interfaceorg.refcodes.component.Initializable
- Throws:
org.refcodes.component.InitializeException
-
onCheckerboardEvent
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onCheckerboardEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aCheckerboardEvent
- the checkerboard event
-
onPlayerAddedEvent
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onPlayerAddedEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aCheckerboardEvent
- the checkerboard event
-
onPlayerRemovedEvent
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onPlayerRemovedEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aCheckerboardEvent
- the checkerboard event
-
onGridModeChangedEvent
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onGridModeChangedEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aCheckerboardEvent
- the checkerboard event
-
onGridDimensionChangedEvent
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onGridDimensionChangedEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aCheckerboardEvent
- the checkerboard event
-
onViewportOffsetChangedEvent
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onViewportOffsetChangedEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aCheckerboardEvent
- the checkerboard event
-
onViewportDimensionChangedEvent
public void onViewportDimensionChangedEvent(ViewportDimensionChangedEvent<P,S> aCheckerboardEvent)This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onViewportDimensionChangedEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aCheckerboardEvent
- the checkerboard event
-
onPlayerEvent
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onPlayerEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aPlayerEvent
- the player eventaSource
- The according source (origin).
-
onChangePositionEvent
public void onChangePositionEvent(ChangePositionEvent<P> aPlayerEvent, Checkerboard<P,S> aSource) throws org.refcodes.exception.VetoExceptionThis method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onChangePositionEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aPlayerEvent
- the player eventaSource
- The according source (origin).- Throws:
org.refcodes.exception.VetoException
- the veto exception
-
onPositionChangedEvent
public void onPositionChangedEvent(PositionChangedEvent<P> aPlayerEvent, Checkerboard<P,S> aSource)This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onPositionChangedEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aPlayerEvent
- the player eventaSource
- The according source (origin).
-
onStateChangedEvent
This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onStateChangedEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aPlayerEvent
- the player eventaSource
- The according source (origin).
-
onVisibilityChangedEvent
public void onVisibilityChangedEvent(VisibilityChangedEvent<P> aPlayerEvent, Checkerboard<P,S> aSource)This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onVisibilityChangedEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aPlayerEvent
- the player eventaSource
- The according source (origin).
-
onDraggabilityChangedEvent
public void onDraggabilityChangedEvent(DraggabilityChangedEvent<P> aPlayerEvent, Checkerboard<P,S> aSource)This method is called when information about an Checkerboard which was previously requested using an asynchronous interface becomes available.- Specified by:
onDraggabilityChangedEvent
in interfaceCheckerboardObserver<P extends Player<P,S>,S>
- Parameters:
aPlayerEvent
- the player eventaSource
- The according source (origin).
-
getRedrawLoopTimeInMillis
public int getRedrawLoopTimeInMillis()Retrieves the refresh loop time between two redraw cycles of theCheckerboard
. This is the delay time between succeeding print outs of theCheckerboard
states to the console. If the refresh loop time is > 0, then theCheckerboard
is redrawn at most with intervals of the given refresh loop time. Attention: TheCheckerboard
is only redrawn in case theCheckerboard
changed compared to the last redraw process.- Specified by:
getRedrawLoopTimeInMillis
in interfaceConsoleCheckerboardViewer<P extends Player<P,S>,S>
- Returns:
- The according time in milliseconds.
-
isRedrawOnEvent
public boolean isRedrawOnEvent()Determines whether theCheckerboard
is printed out upon any according events from the underlyingCheckerboard
or as of the refresh loop time (seeConsoleCheckerboardViewer.getRedrawLoopTimeInMillis()
). Attention: TheCheckerboard
is only redrawn in case theCheckerboard
changed compared to the last redraw process.- Specified by:
isRedrawOnEvent
in interfaceConsoleCheckerboardViewer<P extends Player<P,S>,S>
- Returns:
- True in case the
Checkerboard
is redrawn upon an event from theCheckerboard
or upon the refresh loop time.
-
printPlaygroundDaemon
protected void printPlaygroundDaemon()Loops the playground printing viaprintPlayground()
. -
onEventPrintPlayground
protected void onEventPrintPlayground()Prints the playground upon an accordingCheckerboard
event in case the -
getColumnWidth
public int getColumnWidth()- Specified by:
getColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor
-
setColumnWidth
public void setColumnWidth(int aColumnWidth)- Specified by:
setColumnWidth
in interfaceorg.refcodes.mixin.ColumnWidthAccessor.ColumnWidthMutator
-