com.threerings.cast
Class CharacterComponent

java.lang.Object
  extended by com.threerings.cast.CharacterComponent
All Implemented Interfaces:
Serializable

public class CharacterComponent
extends Object
implements Serializable

The character component represents a single component that can be composited with other character components to generate an image representing a complete character displayable in any of the eight compass directions as detailed in the Sprite class direction constants.

See Also:
Serialized Form

Field Summary
protected  FrameProvider _frameProvider
          The entity from which we obtain our animation frames.
 ComponentClass componentClass
          The class of components to which this one belongs.
 int componentId
          The unique component identifier.
 String name
          The component's name.
 
Constructor Summary
CharacterComponent(int componentId, String name, ComponentClass compClass, FrameProvider fprov)
          Constructs a character component with the specified id of the specified class.
 
Method Summary
 boolean equals(Object other)
           
 String getFramePath(String action, String type, Set<String> existentPaths)
          Returns the path to the image frames for the specified action animation or null if no animation for the specified action is available for this component.
 ActionFrames getFrames(String action, String type)
          Returns the image frames for the specified action animation or null if no animation for the specified action is available for this component.
 int getRenderPriority(String action, int orientation)
          Returns the render priority appropriate for this component at the specified action and orientation.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

componentId

public int componentId
The unique component identifier.


name

public String name
The component's name.


componentClass

public ComponentClass componentClass
The class of components to which this one belongs.


_frameProvider

protected FrameProvider _frameProvider
The entity from which we obtain our animation frames.

Constructor Detail

CharacterComponent

public CharacterComponent(int componentId,
                          String name,
                          ComponentClass compClass,
                          FrameProvider fprov)
Constructs a character component with the specified id of the specified class.

Method Detail

getRenderPriority

public int getRenderPriority(String action,
                             int orientation)
Returns the render priority appropriate for this component at the specified action and orientation.


getFrames

public ActionFrames getFrames(String action,
                              String type)
Returns the image frames for the specified action animation or null if no animation for the specified action is available for this component.

Parameters:
type - null for the normal action frames or one of the custom action sub-types: StandardActions.SHADOW_TYPE, etc.

getFramePath

public String getFramePath(String action,
                           String type,
                           Set<String> existentPaths)
Returns the path to the image frames for the specified action animation or null if no animation for the specified action is available for this component.

Parameters:
type - null for the normal action frames or one of the custom action sub-types: StandardActions.SHADOW_TYPE, etc.
existentPaths - the set of all paths for which there are valid frames.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object