
org.refcodes.checkerboard.impls.AbstractCheckerboardEvent 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.Checkerboard;
import org.refcodes.checkerboard.CheckerboardAction;
import org.refcodes.checkerboard.CheckerboardEvent;
import org.refcodes.checkerboard.Player;
import org.refcodes.checkerboard.PlayerAccessor;
public abstract class AbstractCheckerboardEvent implements CheckerboardEvent {
// /////////////////////////////////////////////////////////////////////////
// STATICS:
// /////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
// CONSTANTS:
// /////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
// VARIABLES:
// /////////////////////////////////////////////////////////////////////////
private Checkerboard _source;
private CheckerboardAction _action;
// /////////////////////////////////////////////////////////////////////////
// CONSTRUCTORS:
// /////////////////////////////////////////////////////////////////////////
public AbstractCheckerboardEvent( CheckerboardAction aAction, Checkerboard aSource ) {
_source = aSource;
_action = aAction;
}
// /////////////////////////////////////////////////////////////////////////
// INJECTION:
// /////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
// METHODS:
// /////////////////////////////////////////////////////////////////////////
@Override
public CheckerboardAction getAction() {
return _action;
}
@Override
public Checkerboard getSource() {
return _source;
}
@Override
public String toString() {
return "action := " + _action;
}
// /////////////////////////////////////////////////////////////////////////
// HOOKS:
// /////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
// HELPER:
// /////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
// INNER CLASSES:
// /////////////////////////////////////////////////////////////////////////
public static abstract class AbstractPlayerCheckerboardEvent extends AbstractCheckerboardEventimplements PlayerAccessor {
// /////////////////////////////////////////////////////////////////////
// STATICS:
// /////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////
// CONSTANTS:
// /////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////
// VARIABLES:
// /////////////////////////////////////////////////////////////////////
private Player _player;
// /////////////////////////////////////////////////////////////////////
// CONSTRUCTORS:
// /////////////////////////////////////////////////////////////////////
public AbstractPlayerCheckerboardEvent( CheckerboardAction aAction, Player aPlayer, Checkerboard aSource ) {
super( aAction, aSource );
_player = aPlayer;
}
// /////////////////////////////////////////////////////////////////////
// INJECTION:
// /////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////
// METHODS:
// /////////////////////////////////////////////////////////////////////
@Override
public Player getPlayer() {
return _player;
}
// /////////////////////////////////////////////////////////////////////
// HOOKS:
// /////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////
// HELPER:
// /////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////
// INNER CLASSES:
// /////////////////////////////////////////////////////////////////////
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy