java.lang.Object com.realtime.crossfire.jxclient.map.AnimationMap
public class AnimationMap
Maintains AnimationState
instances for map locations
.
Field Summary | |
---|---|
private java.util.Map<Location,AnimationState> |
animations
The active AnimationState instances. |
Constructor Summary | |
---|---|
AnimationMap()
|
Method Summary | |
---|---|
void |
add(Location location,
AnimationState animationState)
Adds a new AnimationState to a Location . |
void |
clear()
Forgets all state. |
private static void |
freeAnimationState(AnimationState animationState,
Location location)
Calls AnimationState.free(Location) . |
void |
remove(Location location)
Clears a Location . |
void |
scroll(int dx,
int dy,
int width,
int height)
Scrolls all locations. |
void |
updateSpeed(Location location,
int speed)
Updates the animation speed value of a Location . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private final java.util.Map<Location,AnimationState> animations
AnimationState
instances. Maps map Location
to
AnimationState
instance.
Constructor Detail |
---|
public AnimationMap()
Method Detail |
---|
public void add(@NotNull Location location, @NotNull AnimationState animationState)
AnimationState
to a Location
. If the location
was not empty, the previous animation state is freed.
location
- the location to add toanimationState
- the animation state to addpublic void clear()
private static void freeAnimationState(@Nullable AnimationState animationState, @NotNull Location location)
AnimationState.free(Location)
.
animationState
- the instance to call free()
on or
null
to do nothinglocation
- the location to passpublic void remove(@NotNull Location location)
Location
.
location
- the location to clearpublic void scroll(int dx, int dy, int width, int height)
dx
- the x distance to scrolldy
- the y distance to scrollwidth
- the map widthheight
- the map heightpublic void updateSpeed(@NotNull Location location, int speed)
Location
.
location
- the location to updatespeed
- the new animation speed