Crossfire JXClient, Trunk
R20561
|
The state of an Animation on a map. More...
Public Member Functions | |
void | allocate (@NotNull final MapUpdaterState mapUpdaterState, @NotNull final Location location) |
Adds this animation state to a map Location. More... | |
AnimationState (@NotNull final Animation animation, final int index) | |
Creates a new instance. More... | |
void | free (@NotNull final Location location) |
Removes this animation state from a map Location. More... | |
Iterator< Location > | iterator () |
void | scroll (final int dx, final int dy, final int width, final int height) |
Scrolls all map locations. More... | |
void | setSpeed (@NotNull final MapUpdaterState mapUpdaterState, final int speed) |
Sets the animation speed. More... | |
void | setTickNo (final int tickNo) |
Sets the tick number. More... | |
void | updateTickNo (@NotNull final MapUpdaterState mapUpdaterState, final int tickNo) |
Sets the tick number and update affected faces. More... | |
Private Member Functions | |
void | updateFace (@NotNull final MapUpdaterState mapUpdaterState) |
Updates the map face from the state. More... | |
Private Attributes | |
final Animation | animation |
The Animation to display. More... | |
int | index |
The face index currently shown. More... | |
int | lastFace = -1 |
Records the last known face. More... | |
final Set< Location > | locations = new HashSet<>() |
All map locations this animation is displayed at. More... | |
int | speed = 1 |
The animation speed. More... | |
int | tickNo |
The face was updated last in this tick number. More... | |
The state of an Animation on a map.
Definition at line 36 of file AnimationState.java.
com.realtime.crossfire.jxclient.map.AnimationState.AnimationState | ( | @NotNull final Animation | animation, |
final int | index | ||
) |
Creates a new instance.
animation | the animation to display |
index | the initial face index |
Definition at line 76 of file AnimationState.java.
References com.realtime.crossfire.jxclient.map.AnimationState.animation, and com.realtime.crossfire.jxclient.animations.Animation.getFaces().
void com.realtime.crossfire.jxclient.map.AnimationState.allocate | ( | @NotNull final MapUpdaterState | mapUpdaterState, |
@NotNull final Location | location | ||
) |
Adds this animation state to a map Location.
mapUpdaterState | the map updater state instance to use |
location | the map location |
Definition at line 142 of file AnimationState.java.
void com.realtime.crossfire.jxclient.map.AnimationState.free | ( | @NotNull final Location | location | ) |
Removes this animation state from a map Location.
location | the location to free |
Definition at line 155 of file AnimationState.java.
Iterator<Location> com.realtime.crossfire.jxclient.map.AnimationState.iterator | ( | ) |
Definition at line 166 of file AnimationState.java.
void com.realtime.crossfire.jxclient.map.AnimationState.scroll | ( | final int | dx, |
final int | dy, | ||
final int | width, | ||
final int | height | ||
) |
Scrolls all map locations.
dx | the x distance to scroll |
dy | the y distance to scroll |
width | the map width |
height | the map height |
Definition at line 177 of file AnimationState.java.
void com.realtime.crossfire.jxclient.map.AnimationState.setSpeed | ( | @NotNull final MapUpdaterState | mapUpdaterState, |
final int | speed | ||
) |
Sets the animation speed.
mapUpdaterState | the map updater state instance to use |
speed | the new animation speed to set |
Definition at line 86 of file AnimationState.java.
References com.realtime.crossfire.jxclient.map.AnimationState.speed, and com.realtime.crossfire.jxclient.map.AnimationState.updateFace().
Referenced by com.realtime.crossfire.jxclient.map.AnimationMap.updateSpeed().
void com.realtime.crossfire.jxclient.map.AnimationState.setTickNo | ( | final int | tickNo | ) |
Sets the tick number.
This function does not update the displayed face.
tickNo | the current tick number |
Definition at line 102 of file AnimationState.java.
References com.realtime.crossfire.jxclient.map.AnimationState.tickNo.
|
private |
Updates the map face from the state.
mapUpdaterState | the map updater state instance to use |
Definition at line 126 of file AnimationState.java.
References com.realtime.crossfire.jxclient.animations.Animation.getFace().
Referenced by com.realtime.crossfire.jxclient.map.AnimationState.setSpeed(), and com.realtime.crossfire.jxclient.map.AnimationState.updateTickNo().
void com.realtime.crossfire.jxclient.map.AnimationState.updateTickNo | ( | @NotNull final MapUpdaterState | mapUpdaterState, |
final int | tickNo | ||
) |
Sets the tick number and update affected faces.
mapUpdaterState | the map updater state instance to use |
tickNo | the tick number |
Definition at line 111 of file AnimationState.java.
References com.realtime.crossfire.jxclient.animations.Animation.getFaces(), com.realtime.crossfire.jxclient.map.AnimationState.tickNo, and com.realtime.crossfire.jxclient.map.AnimationState.updateFace().
|
private |
The Animation to display.
Definition at line 42 of file AnimationState.java.
Referenced by com.realtime.crossfire.jxclient.map.AnimationState.AnimationState().
|
private |
The face index currently shown.
May contain values between 0 and speed*animation.getFaces() (exclusive).
Definition at line 58 of file AnimationState.java.
|
private |
Records the last known face.
Used to suppress redundant map updates.
Definition at line 63 of file AnimationState.java.
|
private |
All map locations this animation is displayed at.
Definition at line 69 of file AnimationState.java.
|
private |
The animation speed.
Definition at line 47 of file AnimationState.java.
Referenced by com.realtime.crossfire.jxclient.map.AnimationState.setSpeed().
|
private |
The face was updated last in this tick number.
Definition at line 52 of file AnimationState.java.
Referenced by com.realtime.crossfire.jxclient.map.AnimationState.setTickNo(), and com.realtime.crossfire.jxclient.map.AnimationState.updateTickNo().