Class AnimationState

java.lang.Object
com.realtime.crossfire.jxclient.map.AnimationState
All Implemented Interfaces:
Iterable<Location>

public class AnimationState extends Object implements Iterable<Location>
The state of an Animation on a map.
  • Constructor Details

    • AnimationState

      public AnimationState(@NotNull @NotNull Animation animation, int index, @NotNull @NotNull CfAnimationsMapListener mapListener, @NotNull @NotNull ItemSet itemSet, @NotNull @NotNull FacesManager facesManager)
      Creates a new instance.
      Parameters:
      animation - the animation to display
      index - the initial face index
      mapListener - the map listener to notify of changes
      itemSet - the item set to notify of changes
      facesManager - the faces manager to track for updated faces
  • Method Details

    • setSpeed

      public void setSpeed(int speed)
      Sets the animation speed.
      Parameters:
      speed - the new animation speed to set
    • setTickNo

      public void setTickNo(int tickNo)
      Sets the tick number. This function does not update the displayed face.
      Parameters:
      tickNo - the current tick number
    • updateTickNo

      public void updateTickNo(int tickNo)
      Sets the tick number and update affected faces.
      Parameters:
      tickNo - the tick number
    • allocate

      public void allocate(@NotNull @NotNull Location location)
      Adds this animation state to a map Location.
      Parameters:
      location - the map location
    • allocate

      public void allocate(int tag)
      Adds this animation state to an item tag.
      Parameters:
      tag - the item tag
    • free

      public void free(@NotNull @NotNull Location location)
      Removes this animation state from a map Location.
      Parameters:
      location - the location to free
    • freeAllLocations

      public void freeAllLocations()
      Removes this animation state from all map Locations.
    • free

      public void free(int tag)
      Removes this animation state from an item tag.
      Parameters:
      tag - the item tag to free
    • iterator

      @NotNull public @NotNull Iterator<Location> iterator()
      Specified by:
      iterator in interface Iterable<Location>
    • scroll

      public void scroll(int dx, int dy, int width, int height)
      Scrolls all map locations.
      Parameters:
      dx - the x distance to scroll
      dy - the y distance to scroll
      width - the map width
      height - the map height