public class DefaultAnimationObject extends AbstractNamedObject implements AnimationObject
AnimationObject
.Constructor and Description |
---|
DefaultAnimationObject(java.lang.String animName,
java.lang.String animList,
java.lang.String path)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAnimList()
Returns the animation list of this animation.
|
java.lang.String |
getAnimName()
Get the animName, which is the name of the animation as usable by the
"animations" attribute.
|
java.lang.String |
getDisplayIconName()
Returns the face name of the display icon for this AbstractNamedObject.
|
int |
getFacings()
Get the facings, which is the number of different sub-animations, for
instance for different directions.
|
java.lang.String |
getFirstFrame(int facing)
Get the first frame.
|
java.lang.String |
getFrame(int facing,
int frame)
Get a specific frame.
|
int |
getFrameCount()
Get the number of frames per facing.
|
java.lang.String |
getName()
Get the name of this AbstractNamedObject.
|
java.lang.String |
toString()
The String representation of an AnimationObject is suitable
for writing into the animations file.
|
compareTo, equals, getPath, hashCode, setPath
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPath, setPath
public DefaultAnimationObject(@NotNull java.lang.String animName, @NotNull java.lang.String animList, @NotNull java.lang.String path)
AnimationObjects.addAnimationObject(String,
String, String)
instead. If you invoke this constructor directly, the
created AnimationObject will not be registered.animName
- name of the animationanimList
- list of animation as found between "anim" and "mina",
separated with "\n", including "facings" but including neither "anim" nor
"mina"path
- the path for this animation object@NotNull public java.lang.String getName()
getName
in interface NamedObject
getAnimName()
public int getFacings()
getFacings
in interface AnimationObject
@NotNull public java.lang.String getAnimName()
getAnimName
in interface AnimationObject
getName()
@NotNull public java.lang.String getAnimList()
getAnimList
in interface AnimationObject
public java.lang.String toString()
toString
in interface NamedObject
toString
in class AbstractNamedObject
@NotNull public java.lang.String getDisplayIconName()
getDisplayIconName
in interface NamedObject
@NotNull public java.lang.String getFirstFrame(int facing)
getFirstFrame
in interface AnimationObject
facing
- facing to get frame for, usually a direction@NotNull public java.lang.String getFrame(int facing, int frame) throws java.lang.IndexOutOfBoundsException
facing
- facing to get frame for, usually a directionframe
- index within the sub-animation for facingjava.lang.IndexOutOfBoundsException
- in case the frame or facing is invalidpublic int getFrameCount()