Class PointAnimation

  • All Implemented Interfaces:
    java.io.Serializable

    public class PointAnimation
    extends Animation
    Point animation info for color animations and chain explosions.
    See Also:
    Serialized Form
    • Constructor Detail

      • PointAnimation

        public PointAnimation​(Point point)
        Creates an empty point animation.
        Parameters:
        point - The point.
      • PointAnimation

        public PointAnimation​(Point point,
                              Point target)
        Creates a chain explosion animation.
        Parameters:
        point - The source point.
        target - the target point.
      • PointAnimation

        public PointAnimation​(Point point,
                              int color,
                              int oldColor)
        Creates a color change animation.
        Parameters:
        point - The point.
        color - The new color.
        oldColor - The old color.
      • PointAnimation

        public PointAnimation​(Point point,
                              int color,
                              int oldColor,
                              boolean causedBySwirl)
        Creates a color change animation.
        Parameters:
        point - The point.
        color - The new color.
        oldColor - The old color.
        causedBySwirl - Flag, if caused by swirling.
    • Method Detail

      • getTarget

        public Point getTarget()
        Gets the target point of a chain explosion.
        Returns:
        The chain expl. target.
      • setChainExplosionAnimation

        public void setChainExplosionAnimation​(Point target)
        Sets the target of a chain explosion.
        Parameters:
        target - The target.
      • setColorAnimation

        public PointColorAnimation setColorAnimation​(int color,
                                                     int oldColor)
        Sets the color info with no swirling.
        Parameters:
        color - The new color.
        oldColor - The old color.
        Returns:
        The color animation.
      • setColorAnimation

        public PointColorAnimation setColorAnimation​(int color,
                                                     int oldColor,
                                                     boolean causedBySwirl)
        Sets the color info.
        Parameters:
        color - The new color.
        oldColor - The old color.
        causedBySwirl - Flag, if caused by swirling.
        Returns:
        The color animation.
      • getColor

        public int getColor()
        Gets the new color.
        Returns:
        The new color.
      • getOldColor

        public int getOldColor()
        Gets the old color.
        Returns:
        The old color.
      • isCausedBySwirl

        public boolean isCausedBySwirl()
        Checks, if color effect was caused by swirling.
        Returns:
        The causedBySwirl-flag.
      • setCausedBySwirl

        public void setCausedBySwirl​(boolean causedBySwirl)
        Sets, if color effect was caused by swirling.
        Parameters:
        causedBySwirl - The causedBySwirl-flag to set.
      • hasChainExplosionAnimation

        public boolean hasChainExplosionAnimation()
        Checks, if point has chain explosion animation.
        Returns:
        true, if chain exploding.
      • getChainExplosionAnimationIndex

        public int getChainExplosionAnimationIndex()
        Gets the chain explosion index.
        Returns:
        The chain expl. index.
      • hasColorAnimation

        public boolean hasColorAnimation()
        Checks, if color animation exists.
        Returns:
        true, if color is animated.
      • getCopyForNextAnimation

        protected Animation getCopyForNextAnimation()
        Gets a copy for the next AnimationInfo.
        Overrides:
        getCopyForNextAnimation in class Animation
        Returns:
        This instance with a reduced duration or null, if end of lifecyle is reached.