Class CfMapAnimations
- java.lang.Object
-
- com.realtime.crossfire.jxclient.map.CfMapAnimations
-
public class CfMapAnimations extends java.lang.Object
Manages a set of animated map squares.
-
-
Constructor Summary
Constructors Constructor Description CfMapAnimations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(@NotNull MapUpdaterState mapUpdaterState, @NotNull Location location, @NotNull Animation animation, int type)
Adds a visible animation.void
clear()
Forgets all animations.void
remove(int x, int y)
Removes all visible animations for a tile.void
remove(@NotNull Location location)
Removes a visible animation.void
scroll(int dx, int dy)
Scrolls the animations.void
setMapSize(int width, int height)
Updates the map size.void
tick(@NotNull MapUpdaterState mapUpdaterState, int tickNo)
Processes a tick command.void
updateSpeed(@NotNull MapUpdaterState mapUpdaterState, @NotNull Location location, int speed)
Updates the animation speed value.
-
-
-
Method Detail
-
clear
public void clear()
Forgets all animations.
-
add
public void add(@NotNull @NotNull MapUpdaterState mapUpdaterState, @NotNull @NotNull Location location, @NotNull @NotNull Animation animation, int type)
Adds a visible animation.- Parameters:
mapUpdaterState
- the map updater state instance to uselocation
- the location to animateanimation
- the animation to displaytype
- the animation type
-
remove
public void remove(int x, int y)
Removes all visible animations for a tile.- Parameters:
x
- the x-coordinate to un-animatey
- the y-coordinate to un-animate
-
remove
public void remove(@NotNull @NotNull Location location)
Removes a visible animation.- Parameters:
location
- the location to un-animate
-
updateSpeed
public void updateSpeed(@NotNull @NotNull MapUpdaterState mapUpdaterState, @NotNull @NotNull Location location, int speed)
Updates the animation speed value.- Parameters:
mapUpdaterState
- the map updater state instance to uselocation
- the location to updatespeed
- the new animation speed
-
scroll
public void scroll(int dx, int dy)
Scrolls the animations. Animations scrolled off the visible are are dropped.- Parameters:
dx
- the x-distance to scrolldy
- the y-distance to scroll
-
tick
public void tick(@NotNull @NotNull MapUpdaterState mapUpdaterState, int tickNo)
Processes a tick command.- Parameters:
mapUpdaterState
- the instance to updatetickNo
- the current tick number
-
setMapSize
public void setMapSize(int width, int height)
Updates the map size.- Parameters:
width
- the map widthheight
- the map height
-
-