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(GameObjectFactory<G,A,R> gameObjectFactory,
GameObjectMatchers gameObjectMatchers)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
applyChanges(MapModel<G,A,R> mapModel)
Applies the saved squares to the given map model.
|
void |
clear()
Forgets all saved squares.
|
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(MapSquare<G,A,R> mapSquare)
Records a map square as changed.
|
void |
removeEmptySquares(Size2D size)
Removes empty squares outside a given area.
|
public SavedSquares(@NotNull GameObjectFactory<G,A,R> gameObjectFactory, @NotNull GameObjectMatchers gameObjectMatchers)
gameObjectFactory
- the game object factory to usegameObjectMatchers
- the game object matchers to usepublic void recordMapSquare(@NotNull MapSquare<G,A,R> mapSquare)
mapSquare
- the map square to savepublic boolean isEmpty()
public void clear()
@NotNull public SavedSquares<G,A,R> cloneAndClear()
public void applyChanges(@NotNull MapModel<G,A,R> mapModel)
mapModel
- the map model to changepublic void removeEmptySquares(@NotNull Size2D size)
size
- the area