Class FigureMove

  • All Implemented Interfaces:
    java.io.Serializable

    public class FigureMove
    extends java.lang.Object
    implements java.io.Serializable
    Animation for figure moves.
    See Also:
    Serialized Form
    • Constructor Detail

      • FigureMove

        public FigureMove​(Point srcPoint,
                          Point targetPoint,
                          boolean isRamming,
                          boolean rammingEmpty,
                          int ramPower,
                          Direction ramDir,
                          boolean isBlocked,
                          int animationIndex)
        Creates a figure move.
        Parameters:
        srcPoint - The old point.
        targetPoint - The target point.
        isRamming - Flag if figure is ramming.
        ramPower - The ram power.
        ramDir - The ram direction.
        isBlocked - Flag, if movement is blocked.
    • Method Detail

      • isRamming

        public boolean isRamming()
        Checks, if ramming.
        Returns:
        the isRamming-flag.
      • isRammingEmpty

        public boolean isRammingEmpty()
        Checks, if ramming to empty point.
        Returns:
        the rammingEmpty-flag.
      • isBlocked

        public boolean isBlocked()
        Checks, if movement is blocked.
        Returns:
        true, if blocked.
      • getRamPower

        public int getRamPower()
        Gets the ram power.
        Returns:
        The ram power.
      • getRamDir

        public Direction getRamDir()
        Gets the ram direction.
        Returns:
        the ram dir.
      • getSourceX

        public int getSourceX()
        Returns:
        the sourceX
      • getSourceY

        public int getSourceY()
        Returns:
        the sourceY
      • getTargetX

        public int getTargetX()
        Returns:
        the targetX
      • getTargetY

        public int getTargetY()
        Returns:
        the targetY
      • getAnimationIndex

        public int getAnimationIndex()
        Returns:
        the animationIndex
      • hasMoved

        public boolean hasMoved()
        Checks, if source and target coordinates are equal
        Returns: