public class SavedSquares<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
SavedSquares(@NotNull GameObjectFactory<G,A,R> gameObjectFactory,
@NotNull GameObjectMatchers gameObjectMatchers)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyChanges(@NotNull MapModel<G,A,R> mapModel)
Applies the saved squares to the given map model.
|
void |
clear()
Forgets all saved squares.
|
@NotNull SavedSquares<G,A,R> |
cloneAndClear()
Creates a new instance having the same contents as this instance, then
forgets all saves squares in this instance.
|
boolean |
isEmpty()
Returns whether no saved squares exist.
|
void |
recordMapSquare(@NotNull MapSquare<G,A,R> mapSquare)
Records a map square as changed.
|
void |
removeEmptySquares(@NotNull Size2D size)
Removes empty squares outside a given area.
|
public SavedSquares(@NotNull
@NotNull GameObjectFactory<G,A,R> gameObjectFactory,
@NotNull
@NotNull GameObjectMatchers gameObjectMatchers)
gameObjectFactory - the game object factory to usegameObjectMatchers - the game object matchers to usepublic void recordMapSquare(@NotNull
@NotNull MapSquare<G,A,R> mapSquare)
mapSquare - the map square to savepublic boolean isEmpty()
public void clear()
@NotNull public @NotNull SavedSquares<G,A,R> cloneAndClear()
public void applyChanges(@NotNull
@NotNull MapModel<G,A,R> mapModel)
mapModel - the map model to changepublic void removeEmptySquares(@NotNull
@NotNull Size2D size)
size - the area