Crossfire JXClient, Trunk
R20561
|
Manages a set of animated map squares. More...
Public Member Functions | |
void | add (@NotNull final MapUpdaterState mapUpdaterState, @NotNull final Location location, @NotNull final Animation animation, final int type) |
Adds a visible animation. More... | |
void | clear () |
Forgets all animations. More... | |
void | remove (final int x, final int y) |
Removes all visible animations for a tile. More... | |
void | remove (@NotNull final Location location) |
Removes a visible animation. More... | |
void | scroll (final int dx, final int dy) |
Scrolls the animations. More... | |
void | setMapSize (final int width, final int height) |
Updates the map size. More... | |
void | tick (@NotNull final MapUpdaterState mapUpdaterState, final int tickNo) |
Processes a tick command. More... | |
void | updateSpeed (@NotNull final MapUpdaterState mapUpdaterState, @NotNull final Location location, final int speed) |
Updates the animation speed value. More... | |
Private Attributes | |
final AnimationMap | animations = new AnimationMap() |
The animations in the visible map area. More... | |
final Map< AnimationState, Void > | animationStates = new WeakHashMap<>() |
All AnimationState instances referenced by animations. More... | |
int | height |
The height of the visible map area. More... | |
final Collection< AnimationState > | pendingTickUpdates = new ArrayList<>() |
The AnimationState instances that have been added but not yet received a "tick" value. More... | |
final Random | random = new Random() |
The random number generator for Map2#ANIM_RANDOM type animations. More... | |
final Map< Integer, AnimationState > | syncAnimationStates = new HashMap<>() |
All AnimationState for Map2#ANIM_SYNC animations. More... | |
int | width |
The width of the visible map area. More... | |
Manages a set of animated map squares.
Definition at line 38 of file CfMapAnimations.java.
void com.realtime.crossfire.jxclient.map.CfMapAnimations.add | ( | @NotNull final MapUpdaterState | mapUpdaterState, |
@NotNull final Location | location, | ||
@NotNull final Animation | animation, | ||
final int | type | ||
) |
Adds a visible animation.
mapUpdaterState | the map updater state instance to use |
location | the location to animate |
animation | the animation to display |
type | the animation type |
Definition at line 99 of file CfMapAnimations.java.
References com.realtime.crossfire.jxclient.map.AnimationMap.add(), com.realtime.crossfire.jxclient.protocol.Map2.ANIM_NORMAL, com.realtime.crossfire.jxclient.protocol.Map2.ANIM_RANDOM, and com.realtime.crossfire.jxclient.protocol.Map2.ANIM_SYNC.
Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.mapAnimation().
void com.realtime.crossfire.jxclient.map.CfMapAnimations.clear | ( | ) |
Forgets all animations.
Definition at line 85 of file CfMapAnimations.java.
References com.realtime.crossfire.jxclient.map.AnimationMap.clear().
Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.mapScroll(), and com.realtime.crossfire.jxclient.map.CfMapAnimations.setMapSize().
void com.realtime.crossfire.jxclient.map.CfMapAnimations.remove | ( | final int | x, |
final int | y | ||
) |
Removes all visible animations for a tile.
x | the x-coordinate to un-animate |
y | the y-coordinate to un-animate |
Definition at line 144 of file CfMapAnimations.java.
References com.realtime.crossfire.jxclient.protocol.Map2.NUM_LAYERS, and com.realtime.crossfire.jxclient.map.AnimationMap.remove().
Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.mapClear(), com.realtime.crossfire.jxclient.map.MapUpdaterState.mapFace(), and com.realtime.crossfire.jxclient.map.MapUpdaterState.mapScroll().
void com.realtime.crossfire.jxclient.map.CfMapAnimations.remove | ( | @NotNull final Location | location | ) |
Removes a visible animation.
location | the location to un-animate |
Definition at line 154 of file CfMapAnimations.java.
References com.realtime.crossfire.jxclient.map.AnimationMap.remove().
void com.realtime.crossfire.jxclient.map.CfMapAnimations.scroll | ( | final int | dx, |
final int | dy | ||
) |
Scrolls the animations.
Animations scrolled off the visible are are dropped.
dx | the x-distance to scroll |
dy | the y-distance to scroll |
Definition at line 174 of file CfMapAnimations.java.
References com.realtime.crossfire.jxclient.map.AnimationMap.scroll().
Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.mapScroll().
void com.realtime.crossfire.jxclient.map.CfMapAnimations.setMapSize | ( | final int | width, |
final int | height | ||
) |
Updates the map size.
width | the map width |
height | the map height |
Definition at line 202 of file CfMapAnimations.java.
References com.realtime.crossfire.jxclient.map.CfMapAnimations.clear(), com.realtime.crossfire.jxclient.map.CfMapAnimations.height, and com.realtime.crossfire.jxclient.map.CfMapAnimations.width.
Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.newMap().
void com.realtime.crossfire.jxclient.map.CfMapAnimations.tick | ( | @NotNull final MapUpdaterState | mapUpdaterState, |
final int | tickNo | ||
) |
Processes a tick command.
mapUpdaterState | the instance to update |
tickNo | the current tick number |
Definition at line 183 of file CfMapAnimations.java.
Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.tick().
void com.realtime.crossfire.jxclient.map.CfMapAnimations.updateSpeed | ( | @NotNull final MapUpdaterState | mapUpdaterState, |
@NotNull final Location | location, | ||
final int | speed | ||
) |
Updates the animation speed value.
mapUpdaterState | the map updater state instance to use |
location | the location to update |
speed | the new animation speed |
Definition at line 164 of file CfMapAnimations.java.
References com.realtime.crossfire.jxclient.map.AnimationMap.updateSpeed().
Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.mapAnimationSpeed().
|
private |
The animations in the visible map area.
Definition at line 61 of file CfMapAnimations.java.
|
private |
All AnimationState instances referenced by animations.
Definition at line 67 of file CfMapAnimations.java.
|
private |
The height of the visible map area.
Definition at line 55 of file CfMapAnimations.java.
Referenced by com.realtime.crossfire.jxclient.map.CfMapAnimations.setMapSize().
|
private |
The AnimationState instances that have been added but not yet received a "tick" value.
Definition at line 80 of file CfMapAnimations.java.
|
private |
The random number generator for Map2#ANIM_RANDOM type animations.
Definition at line 45 of file CfMapAnimations.java.
|
private |
All AnimationState for Map2#ANIM_SYNC animations.
Definition at line 73 of file CfMapAnimations.java.
|
private |
The width of the visible map area.
Definition at line 50 of file CfMapAnimations.java.
Referenced by com.realtime.crossfire.jxclient.map.CfMapAnimations.setMapSize().