Skip to content

funtracks.actions.action_history

ActionHistory

ActionHistory()

An action history implementing the ideas from this blog: https://github.com/zaboople/klonk/blob/master/TheGURQ.md Essentially, if you go back and change something after undo-ing, you can always get back to every state if you undo far enough (instead of throwing out the undone actions)

add_new_action

add_new_action(action: Action) -> None

Add a newly performed action to the history. Args: action (Action): The new action to be added to the history.

redo

redo() -> bool

Redo the last undone action

Returns:

Name Type Description
bool bool

True if an action was redone, and False

bool

if there was no undone action to redo.

undo

undo() -> bool

Undo the last performed action

Returns:

Name Type Description
bool bool

True if an action was undone, and False

bool

if there was no previous action to undo.