|
Gridarta Editor
|
Records a set of changed map squares. More...
Inheritance diagram for net.sf.gridarta.model.mapmodel.SavedSquares< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
Collaboration diagram for net.sf.gridarta.model.mapmodel.SavedSquares< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:Public Member Functions | |
| void | applyChanges (@NotNull final MapModel< G, A, R > mapModel) |
| Applies the saved squares to the given map model. More... | |
| void | clear () |
| Forgets all saved squares. More... | |
| SavedSquares< G, A, R > | cloneAndClear () |
| Creates a new instance having the same contents as this instance, then forgets all saves squares in this instance. More... | |
| boolean | isEmpty () |
| Returns whether no saved squares exist. More... | |
| void | recordMapSquare (@NotNull final MapSquare< G, A, R > mapSquare) |
| Records a map square as changed. More... | |
| void | removeEmptySquares (@NotNull final Size2D size) |
| Removes empty squares outside a given area. More... | |
| SavedSquares (@NotNull final GameObjectFactory< G, A, R > gameObjectFactory, @NotNull final GameObjectMatchers gameObjectMatchers) | |
| Creates a new instance. More... | |
Private Member Functions | |
| ArrayList< G > | allocateMapSquare (final int x, final int y) |
| Allocates a saved map square. More... | |
| boolean | isOutsideEmpty (final int width, final int height) |
| Returns whether all squares outside a given area are empty or unchanged. More... | |
Private Attributes | |
| final GameObjectFactory< G, A, R > | gameObjectFactory |
| The GameObjectFactory to use. More... | |
| final GameObjectMatchers | gameObjectMatchers |
| The GameObjectMatchers to use. More... | |
| final List< ArrayList< ArrayList< G > > > | savedSquares = new ArrayList<>() |
| The saved squares. More... | |
Static Private Attributes | |
| static final long | serialVersionUID = 1L |
| The serial version UID. More... | |
Records a set of changed map squares.
Definition at line 41 of file SavedSquares.java.
| net.sf.gridarta.model.mapmodel.SavedSquares< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.SavedSquares | ( | @NotNull final GameObjectFactory< G, A, R > | gameObjectFactory, |
| @NotNull final GameObjectMatchers | gameObjectMatchers | ||
| ) |
Creates a new instance.
| gameObjectFactory | the game object factory to use |
| gameObjectMatchers | the game object matchers to use |
Definition at line 72 of file SavedSquares.java.
|
private |
Allocates a saved map square.
| x | the x-coordinate |
| y | the y-coordinate |
Definition at line 106 of file SavedSquares.java.
Referenced by net.sf.gridarta.model.mapmodel.SavedSquares< G, A, R >.recordMapSquare().
Here is the caller graph for this function:| void net.sf.gridarta.model.mapmodel.SavedSquares< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.applyChanges | ( | @NotNull final MapModel< G, A, R > | mapModel | ) |
Applies the saved squares to the given map model.
| mapModel | the map model to change |
Definition at line 176 of file SavedSquares.java.
| void net.sf.gridarta.model.mapmodel.SavedSquares< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.clear | ( | ) |
Forgets all saved squares.
Definition at line 155 of file SavedSquares.java.
Referenced by net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.fireBeginTransaction(), and net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.fireEndTransaction().
Here is the caller graph for this function:| SavedSquares<G, A, R> net.sf.gridarta.model.mapmodel.SavedSquares< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.cloneAndClear | ( | ) |
Creates a new instance having the same contents as this instance, then forgets all saves squares in this instance.
Definition at line 165 of file SavedSquares.java.
Here is the caller graph for this function:| boolean net.sf.gridarta.model.mapmodel.SavedSquares< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isEmpty | ( | ) |
Returns whether no saved squares exist.
Definition at line 148 of file SavedSquares.java.
|
private |
Returns whether all squares outside a given area are empty or unchanged.
| width | the width of the area |
| height | the height of the area |
Definition at line 261 of file SavedSquares.java.
Referenced by net.sf.gridarta.model.mapmodel.SavedSquares< G, A, R >.removeEmptySquares().
Here is the caller graph for this function:| void net.sf.gridarta.model.mapmodel.SavedSquares< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.recordMapSquare | ( | @NotNull final MapSquare< G, A, R > | mapSquare | ) |
Records a map square as changed.
Does nothing if the square already has been saved.
| mapSquare | the map square to save |
Definition at line 82 of file SavedSquares.java.
Referenced by net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.beginGameObjectChange(), and net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.beginSquareChange().
Here is the caller graph for this function:| void net.sf.gridarta.model.mapmodel.SavedSquares< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.removeEmptySquares | ( | @NotNull final Size2D | size | ) |
Removes empty squares outside a given area.
| size | the area |
Definition at line 234 of file SavedSquares.java.
Here is the caller graph for this function:
|
private |
The GameObjectFactory to use.
Definition at line 59 of file SavedSquares.java.
Referenced by net.sf.gridarta.model.mapmodel.SavedSquares< G, A, R >.cloneAndClear(), and net.sf.gridarta.model.mapmodel.SavedSquares< G, A, R >.SavedSquares().
|
private |
The GameObjectMatchers to use.
Definition at line 65 of file SavedSquares.java.
Referenced by net.sf.gridarta.model.mapmodel.SavedSquares< G, A, R >.cloneAndClear(), and net.sf.gridarta.model.mapmodel.SavedSquares< G, A, R >.SavedSquares().
|
private |
The saved squares.
Maps x-coordinate to y-coordinate to map squares contents. Not saved map squares (or map columns) are null.
Definition at line 53 of file SavedSquares.java.
Referenced by net.sf.gridarta.model.mapmodel.SavedSquares< G, A, R >.cloneAndClear().
|
staticprivate |
The serial version UID.
Definition at line 46 of file SavedSquares.java.