Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CfMapAnimations

        public CfMapAnimations()
    • 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 use
        location - the location to animate
        animation - the animation to display
        type - 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-animate
        y - 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 use
        location - the location to update
        speed - 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 scroll
        dy - the y-distance to scroll
      • tick

        public void tick​(@NotNull
                         @NotNull MapUpdaterState mapUpdaterState,
                         int tickNo)
        Processes a tick command.
        Parameters:
        mapUpdaterState - the instance to update
        tickNo - the current tick number
      • setMapSize

        public void setMapSize​(int width,
                               int height)
        Updates the map size.
        Parameters:
        width - the map width
        height - the map height