Go to the documentation of this file.
20 package net.sf.gridarta.model.undo;
22 import java.util.ArrayList;
23 import java.util.List;
31 import org.jetbrains.annotations.NotNull;
65 private final List<UndoState<G, A, R>>
undoStack =
new ArrayList<>();
119 while (
undoStack.size() > maxUndoStates) {
152 throw new IllegalStateException(
"undo stack is empty");
164 throw new IllegalStateException(
"redo stack is empty");
178 throw new IllegalStateException(
"undo stack is empty");
195 throw new IllegalStateException(
"redo stack is empty");
final GameObjectFactory< G, A, R > gameObjectFactory
final MapTransactionListener< G, A, R > mapTransactionListener
void setSavedSquares(@NotNull final SavedSquares< G, A, R > savedSquares)
void finish(@NotNull final UndoState< G, A, R > undoState)
void addUndoState(@NotNull final UndoState< G, A, R > undoState)
void trimToSize(final int maxUndoStates)
UndoModel(@NotNull final GameObjectFactory< G, A, R > gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final MapTransactionListener< G, A, R > mapTransactionListener)
UndoState< G, A, R > undo()
final GameObjectMatchers gameObjectMatchers
MapTransactionListener< G, A, R > getMapTransactionListener()
final List< UndoState< G, A, R > > undoStack
UndoState< G, A, R > redo()