public class ComponentClass extends Object implements Serializable
CharacterComponent
objects belong. Examples include "Hat", "Head", and "Feet". A component
class dictates a component's rendering priority so that components can
be rendered in an order that causes them to overlap properly.
Components support render priority overrides for particular actions, orientations or combinations of actions and orientations. The system is currently structured with the expectation that the overrides will be relatively few (less than fifteen, say) for any given component class. A system that relied on many overrides for its components would want to implement a more scalable algorithm for determining which, if any, override matches a particular action and orientation combination.
| Modifier and Type | Class and Description |
|---|---|
static class |
ComponentClass.PriorityOverride
Used to effect custom render orders for particular actions, orientations, etc.
|
| Modifier and Type | Field and Description |
|---|---|
String[] |
colors
The color classes to use when recoloring components of this class.
|
String |
mask
The class name of the layer from which this component class obtains a
mask to limit rendering to certain areas.
|
String |
name
The component class name.
|
int |
renderPriority
The default render priority.
|
String |
shadow
Indicates the class name of the shadow layer to which this component
class contributes a shadow.
|
float |
shadowAlpha
1.0 for a normal component, the alpha value of the pre-composited
shadow for the special "shadow" component class.
|
boolean |
translate
Whether or not components of this class will have translations applied.
|
| Constructor and Description |
|---|
ComponentClass()
Creates an uninitialized instance suitable for unserialization or
population during XML parsing.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPriorityOverride(ComponentClass.PriorityOverride override)
Adds the supplied render priority override record to this component class.
|
boolean |
equals(Object other)
Classes with the same name are the same.
|
int |
getRenderPriority(String action,
int orientation)
Deprecated.
|
int |
getRenderPriority(String action,
String component,
int orientation)
Returns the render priority appropriate for the specified action, orientation and
component.
|
int |
hashCode()
Hashcode is based on component class name.
|
boolean |
isShadow()
Returns true if this component class is a shadow layer rather than a normal component class.
|
boolean |
isShadowed()
Returns true if this component class contributes a shadow to a
particular shadow layer.
|
String |
toString() |
public String name
public int renderPriority
public String[] colors
public String mask
public String shadow
public float shadowAlpha
public boolean translate
public ComponentClass()
@Deprecated public int getRenderPriority(String action, int orientation)
getRenderPriority(String, String, int)
to handle potential per-component priority overrides.public int getRenderPriority(String action, String component, int orientation)
public void addPriorityOverride(ComponentClass.PriorityOverride override)
public boolean isShadowed()
isShadow().public boolean isShadow()
public boolean equals(Object other)
public int hashCode()
Copyright © 2015. All rights reserved.