public interface UndoableAction
Modifier and Type | Interface | Description |
---|---|---|
static class |
UndoableAction.Utils |
Modifier and Type | Method | Description |
---|---|---|
double |
doAction(double currentScore,
double desparationValue) |
Perform an action
|
boolean |
isActionDeterministic() |
Was the last action deterministic? That is, if it wasn't chosen and state is still as
before is it worth doing it again?
|
boolean |
isActionSuccessful() |
Was the last call to doAction() succesful?
|
boolean |
undoAction() |
Undo the last action (if it was successful)
Users of undoable actions should accept that sometimes it isn't possible.
|
double doAction(double currentScore, double desparationValue)
currentscore
- The current score before doing the actiondesparationValue
- An indication by the processing machines of willingness to do more extreme actions. A value of 0 means not desparate at all, a value of 1 means very desparateboolean isActionDeterministic()
boolean isActionSuccessful()
boolean undoAction()