
org.refcodes.checkerboard.impls.StateChangedEventImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of refcodes-checkerboard Show documentation
Show all versions of refcodes-checkerboard Show documentation
Artifact for providing some easy means to visualize (state of) board
games or (state of) cellular automatons.
package org.refcodes.checkerboard.impls;
import org.refcodes.checkerboard.Player;
import org.refcodes.checkerboard.StateChangedEvent;
public class StateChangedEventImpl extends AbstractPlayerEvent implements StateChangedEvent {
// /////////////////////////////////////////////////////////////////////////
// STATICS:
// /////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
// CONSTANTS:
// /////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
// VARIABLES:
// /////////////////////////////////////////////////////////////////////////
private S _state;
private S _precedingState;
// /////////////////////////////////////////////////////////////////////////
// CONSTRUCTORS:
// /////////////////////////////////////////////////////////////////////////
public StateChangedEventImpl( S aState, S aPrecedingState, Player aSource ) {
super( ACTION, aSource );
_state = aState;
_precedingState = aPrecedingState;
}
// /////////////////////////////////////////////////////////////////////////
// INJECTION:
// /////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
// METHODS:
// /////////////////////////////////////////////////////////////////////////
@Override
public S getState() {
return _state;
}
@Override
public S getPrecedingState() {
return _precedingState;
}
@Override
public String toString() {
return super.toString() + ", state := " + _state + " (state before: " + _precedingState + ")";
}
// /////////////////////////////////////////////////////////////////////////
// HOOKS:
// /////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
// HELPER:
// /////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
// INNER CLASSES:
// /////////////////////////////////////////////////////////////////////////
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy