Class AnimationState
java.lang.Object
com.realtime.crossfire.jxclient.map.AnimationState
The state of an
Animation on a map.-
Constructor Summary
ConstructorsConstructorDescriptionAnimationState(@NotNull Animation animation, int index, @NotNull CfAnimationsMapListener mapListener, @NotNull ItemSet itemSet, @NotNull FacesManager facesManager) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidallocate(int tag) Adds this animation state to an item tag.voidAdds this animation state to a mapLocation.voidfree(int tag) Removes this animation state from an item tag.voidRemoves this animation state from a mapLocation.voidRemoves this animation state from all mapLocations.iterator()voidscroll(int dx, int dy, int width, int height) Scrolls all map locations.voidsetSpeed(int speed) Sets the animation speed.voidsetTickNo(int tickNo) Sets the tick number.voidupdateTickNo(int tickNo) Sets the tick number and update affected faces.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
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 displayindex- the initial face indexmapListener- the map listener to notify of changesitemSet- the item set to notify of changesfacesManager- 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
Adds this animation state to a mapLocation.- 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
Removes this animation state from a mapLocation.- Parameters:
location- the location to free
-
freeAllLocations
public void freeAllLocations()Removes this animation state from all mapLocations. -
free
public void free(int tag) Removes this animation state from an item tag.- Parameters:
tag- the item tag to free
-
iterator
-
scroll
public void scroll(int dx, int dy, int width, int height) Scrolls all map locations.- Parameters:
dx- the x distance to scrolldy- the y distance to scrollwidth- the map widthheight- the map height
-