public class UndoState<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
| Constructor and Description |
|---|
UndoState(java.lang.String name,
A mapArchObject)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
A |
getMapArchObject()
Returns the map arch object before the operation started.
|
java.lang.String |
getName()
Return the name of the operation.
|
SavedSquares<G,A,R> |
getSavedSquares()
Returns the map squares that have changed in the operation.
|
void |
setSavedSquares(SavedSquares<G,A,R> savedSquares)
Records the affected map squares.
|
public UndoState(@NotNull
java.lang.String name,
@NotNull
A mapArchObject)
name - the name of the operationmapArchObject - the map arch object to store; the value is
not copied@NotNull public java.lang.String getName()
public void setSavedSquares(@NotNull
SavedSquares<G,A,R> savedSquares)
savedSquares - the map squares to recordjava.lang.IllegalStateException - if changed map squares have been recorded
before@NotNull public SavedSquares<G,A,R> getSavedSquares()
java.lang.IllegalStateException - if no saved squares have been recorded@NotNull public A getMapArchObject()