Class ActionHistory
java.lang.Object
group24.escaperoom.screens.editor.ActionHistory
Utility class to manage the undo/redo history
in the
LevelEditorScreen-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn EditorAction modifies theLevelEditorScreenin a way that can be undone and redone -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.scenes.scene2d.ui.ImageButtoncom.badlogic.gdx.scenes.scene2d.ui.ImageButtonvoidrecord(ActionHistory.EditorAction action) booleanredo()booleanundo()
-
Constructor Details
-
ActionHistory
public ActionHistory()
-
-
Method Details
-
getUndoButton
public com.badlogic.gdx.scenes.scene2d.ui.ImageButton getUndoButton()- Returns:
- the button which, when pressed, undoes an
ActionHistory.EditorAction
-
getRedoButton
public com.badlogic.gdx.scenes.scene2d.ui.ImageButton getRedoButton()- Returns:
- the button which, when pressed, redoes an
ActionHistory.EditorAction
-
record
- Parameters:
action- the action to record
-
undo
public boolean undo()- Returns:
- whether or not there is an action to undo
-
redo
public boolean redo()- Returns:
- whether or not there is an action to redo
-