com.realtime.crossfire.jxclient.animations
Class Animations

java.lang.Object
  extended by com.realtime.crossfire.jxclient.animations.Animations

public class Animations
extends java.lang.Object

Manages animations received from the server. Animations are uniquely identified by an animation id. Each animation consists of a list of faces.


Field Summary
private  java.util.Map<java.lang.Integer,Animation> animations
          All defined animations.
private  GuiStateListener guiStateListener
          The GuiStateListener for detecting established or dropped connections.
 
Constructor Summary
Animations(GuiStateManager guiStateManager)
          Creates a new instance.
 
Method Summary
 void addAnimation(int animationId, int flags, int[] faces)
          Defines a new animation.
 Animation get(int animationId)
          Returns the animation for an animation id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

animations

@NotNull
private final java.util.Map<java.lang.Integer,Animation> animations
All defined animations. Maps animation id to animation instance.


guiStateListener

@NotNull
private final GuiStateListener guiStateListener
The GuiStateListener for detecting established or dropped connections.

Constructor Detail

Animations

public Animations(@Nullable
                  GuiStateManager guiStateManager)
Creates a new instance.

Parameters:
guiStateManager - the gui state manager to watch; null to not watch
Method Detail

addAnimation

public void addAnimation(int animationId,
                         int flags,
                         @NotNull
                         int[] faces)
Defines a new animation.

Parameters:
animationId - the animation id
flags - flags for the animation; currently unused
faces - the faces list of the animation

get

@Nullable
public Animation get(int animationId)
Returns the animation for an animation id.

Parameters:
animationId - the animation id
Returns:
the animation instance, or null if the animation id does not exist