ch.tatool.core.element.handler.score
Class AbstractPointsAndLevelHandler
java.lang.Object
ch.tatool.core.element.AbstractPropertyHolder
ch.tatool.core.element.NodeImpl
ch.tatool.core.element.handler.score.AbstractPointsAndLevelHandler
- All Implemented Interfaces:
- PointsAndLevelHandler, PropertyHolder, Node, ExecutionPhaseListener
- Direct Known Subclasses:
- AdaptiveScoreAndLevelHandler, BoundaryPointsAndLevelHandler, DefaultPointsAndLevelHandler
public abstract class AbstractPointsAndLevelHandler
- extends NodeImpl
- implements ExecutionPhaseListener, PointsAndLevelHandler
Abstract store and level handler. Implements the PointAdapter logic and provides
utility methods for subclasses.
- Author:
- Michael Ruflin
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZERO_POINTS
protected static final int ZERO_POINTS
- See Also:
- Constant Field Values
startLevel
public int startLevel
startMinPoints
public int startMinPoints
startMaxPoints
public int startMaxPoints
startPoints
public int startPoints
AbstractPointsAndLevelHandler
public AbstractPointsAndLevelHandler()
AbstractPointsAndLevelHandler
public AbstractPointsAndLevelHandler(String id)
getDescription
public String getDescription()
setDescription
public void setDescription(String description)
processExecutionPhase
public void processExecutionPhase(ExecutionContext context)
- Called by the Executor to signal a new phase in the execution
- Specified by:
processExecutionPhase in interface ExecutionPhaseListener
- Parameters:
context -
updateStatusRegion
protected void updateStatusRegion(ExecutionContext context)
- Updates the level status panel.
processPoints
protected void processPoints(ExecutionContext context)
- Processes the points set by the executable element.
This default implementation first mirrors the points as set by the executable element,
followed by letting all PointAdaptors set on the executable element as aspects adapt
the points as they wish.
updateTotals
protected void updateTotals(ExecutionContext context)
processLevel
protected void processLevel(ExecutionContext context)
- Checks for level changes.
The actual level check is done by checkLevelChange. This method merely takes care of informing
the LevelChangeListeners in case a level change happened.
informLevelChangeListeners
protected void informLevelChangeListeners(ExecutionContext context)
- Informs all listeners in the execution stack about a level change.
checkLevelChange
protected abstract int checkLevelChange(ExecutionContext context,
int currentLevel)
- Overwrite to implement a different level/points logic.
Default logic simply uses += level = > +- 100.
- Returns:
- the new level. This can be the old level value
initializeHandler
protected abstract void initializeHandler(ExecutionContext context)
Copyright © 2012. All Rights Reserved.