|
Gridarta Editor
|
Tracks a MapModel for light emitting game objects. More...
Inheritance diagram for net.sf.gridarta.model.mapmodel.LightMapModelTracker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
Collaboration diagram for net.sf.gridarta.model.mapmodel.LightMapModelTracker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:Public Member Functions | |
| LightMapModelTracker (@NotNull final MapModel< G, A, R > mapModel) | |
| Creates a new instance. More... | |
| void | mapSizeChanging (@NotNull final Size2D newSize, @NotNull final Size2D oldSize) |
| Called whenever the tracked map is about to change size. More... | |
| void | mapSquaresChanged (@NotNull final Iterable< MapSquare< G, A, R >> mapSquares) |
| Called whenever some game objects have changed. More... | |
Private Member Functions | |
| void | setLightRadius (@NotNull final MapSquare< G, A, R > mapSquare, final int lightRadius) |
| Updates the light radius of a map square. More... | |
| void | updateLightRadius (@NotNull final MapSquare< G, A, R > mapSquare) |
| Recalculates information about light emitting game objects in a map square. More... | |
Private Attributes | |
| final MapModel< G, A, R > | mapModel |
| The tracked MapModel. More... | |
| final Point | point = new Point() |
| A temporary point. More... | |
| final Point | point2 = new Point() |
| A temporary point. More... | |
Static Private Attributes | |
| static final int | MAX_LIGHT_RADIUS = 4 |
| The maximal supported light radius. More... | |
Tracks a MapModel for light emitting game objects.
Whenever such a game object is added to, removed from, or modified while on the map, all affected map squares are updated.
Definition at line 35 of file LightMapModelTracker.java.
| net.sf.gridarta.model.mapmodel.LightMapModelTracker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.LightMapModelTracker | ( | @NotNull final MapModel< G, A, R > | mapModel | ) |
Creates a new instance.
| mapModel | the tracked map model |
Definition at line 65 of file LightMapModelTracker.java.
| void net.sf.gridarta.model.mapmodel.LightMapModelTracker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapSizeChanging | ( | @NotNull final Size2D | newSize, |
| @NotNull final Size2D | oldSize | ||
| ) |
Called whenever the tracked map is about to change size.
| newSize | the new map size |
| oldSize | the current map size |
Definition at line 74 of file LightMapModelTracker.java.
Here is the caller graph for this function:| void net.sf.gridarta.model.mapmodel.LightMapModelTracker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapSquaresChanged | ( | @NotNull final Iterable< MapSquare< G, A, R >> | mapSquares | ) |
Called whenever some game objects have changed.
| mapSquares | the map square that contain changed game objects |
Definition at line 97 of file LightMapModelTracker.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 >.endSquareChange(), and net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.fireEvents().
Here is the caller graph for this function:
|
private |
Updates the light radius of a map square.
The light radius is the maximal light radius of all light emitting game objects in the map square.
| mapSquare | the map square to update |
| lightRadius | the new light radius to set |
Definition at line 125 of file LightMapModelTracker.java.
Referenced by net.sf.gridarta.model.mapmodel.LightMapModelTracker< G, A, R >.mapSizeChanging(), and net.sf.gridarta.model.mapmodel.LightMapModelTracker< G, A, R >.updateLightRadius().
Here is the caller graph for this function:
|
private |
Recalculates information about light emitting game objects in a map square.
| mapSquare | the map square |
Definition at line 108 of file LightMapModelTracker.java.
Referenced by net.sf.gridarta.model.mapmodel.LightMapModelTracker< G, A, R >.mapSquaresChanged().
Here is the caller graph for this function:
|
private |
The tracked MapModel.
Definition at line 47 of file LightMapModelTracker.java.
Referenced by net.sf.gridarta.model.mapmodel.LightMapModelTracker< G, A, R >.LightMapModelTracker().
|
staticprivate |
The maximal supported light radius.
The return values of GameObject#getLightRadius() is clipped to this value.
Definition at line 41 of file LightMapModelTracker.java.
|
private |
A temporary point.
Stored in a field to avoid reallocations.
Definition at line 53 of file LightMapModelTracker.java.
|
private |
A temporary point.
Stored in a field to avoid reallocations.
Definition at line 59 of file LightMapModelTracker.java.