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(@NotNull java.lang.String name,
A mapArchObject)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
A |
getMapArchObject()
Returns the map arch object before the operation started.
|
@NotNull java.lang.String |
getName()
Return the name of the operation.
|
@NotNull SavedSquares<G,A,R> |
getSavedSquares()
Returns the map squares that have changed in the operation.
|
void |
setSavedSquares(@NotNull SavedSquares<G,A,R> savedSquares)
Records the affected map squares.
|
public UndoState(@NotNull @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 @NotNull java.lang.String getName()
public void setSavedSquares(@NotNull @NotNull SavedSquares<G,A,R> savedSquares)
savedSquares
- the map squares to recordjava.lang.IllegalStateException
- if changed map squares have been recorded
before@NotNull public @NotNull SavedSquares<G,A,R> getSavedSquares()
java.lang.IllegalStateException
- if no saved squares have been recorded@NotNull public A getMapArchObject()