Class DefaultAnimationObject

    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultAnimationObject​(@NotNull java.lang.String animName, @NotNull java.lang.String animList, @NotNull java.lang.String path)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.lang.String getAnimList()
      Returns the animation list of this animation.
      @NotNull java.lang.String getAnimName()
      Get the animName, which is the name of the animation as usable by the "animations" attribute.
      @NotNull 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.
      @NotNull java.lang.String getFirstFrame​(int facing)
      Get the first frame.
      int getFrameCount()
      Get the number of frames per facing.
      @NotNull 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.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Constructor Detail

      • DefaultAnimationObject

        public DefaultAnimationObject​(@NotNull
                                      @NotNull java.lang.String animName,
                                      @NotNull
                                      @NotNull java.lang.String animList,
                                      @NotNull
                                      @NotNull java.lang.String path)
        Creates a new instance. Therefore animList is parsed. Do not invoke this constructor directly, use AnimationObjects.addAnimationObject(String, String, String) instead. If you invoke this constructor directly, the created AnimationObject will not be registered.
        Parameters:
        animName - name of the animation
        animList - 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
    • Method Detail

      • getName

        @NotNull
        public @NotNull java.lang.String getName()
        Description copied from interface: NamedObject
        Get the name of this AbstractNamedObject. The name should be of user presentable but 100% machine processable nature, means it must be usable for reverse lookup of this AbstractNamedObject in Maps. For faces, the name should be the face name. For animations, the name should be the animation name. For arch objects, the name should be the arch name (definitely not the title).
        Specified by:
        getName in interface NamedObject
        Returns:
        the same String as getAnimName()
      • getFacings

        public int getFacings()
        Description copied from interface: AnimationObject
        Get the facings, which is the number of different sub-animations, for instance for different directions.
        Specified by:
        getFacings in interface AnimationObject
        Returns:
        facings
      • getAnimName

        @NotNull
        public @NotNull java.lang.String getAnimName()
        Description copied from interface: AnimationObject
        Get the animName, which is the name of the animation as usable by the "animations" attribute.
        Specified by:
        getAnimName in interface AnimationObject
        Returns:
        the name of this animation
        See Also:
        getName()
      • getAnimList

        @NotNull
        public @NotNull java.lang.String getAnimList()
        Description copied from interface: AnimationObject
        Returns the animation list of this animation. The individual entries are all suffixed with '\n'.
        Specified by:
        getAnimList in interface AnimationObject
        Returns:
        the animation list of this animation
      • toString

        public java.lang.String toString()
        The String representation of an AnimationObject is suitable for writing into the animations file.
        Specified by:
        toString in interface NamedObject
        Overrides:
        toString in class AbstractNamedObject
      • getDisplayIconName

        @NotNull
        public @NotNull java.lang.String getDisplayIconName()
        Description copied from interface: NamedObject
        Returns the face name of the display icon for this AbstractNamedObject.
        Specified by:
        getDisplayIconName in interface NamedObject
        Returns:
        the face name
      • getFirstFrame

        @NotNull
        public @NotNull java.lang.String getFirstFrame​(int facing)
        Description copied from interface: AnimationObject
        Get the first frame.
        Specified by:
        getFirstFrame in interface AnimationObject
        Parameters:
        facing - facing to get frame for, usually a direction
        Returns:
        frame
      • getFrameCount

        public int getFrameCount()
        Get the number of frames per facing.
        Returns:
        number of frames per facing