Package com.starpoints.state
Class FigureMove
- java.lang.Object
-
- com.starpoints.state.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 Summary
Constructors Constructor Description FigureMove(Point srcPoint, Point targetPoint, boolean isRamming, boolean rammingEmpty, int ramPower, Direction ramDir, boolean isBlocked, int animationIndex)
Creates a figure move.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAnimationIndex()
Direction
getRamDir()
Gets the ram direction.int
getRamPower()
Gets the ram power.int
getSourceX()
int
getSourceY()
int
getTargetX()
int
getTargetY()
boolean
hasMoved()
Checks, if source and target coordinates are equalboolean
isBlocked()
Checks, if movement is blocked.boolean
isRamming()
Checks, if ramming.boolean
isRammingEmpty()
Checks, if ramming to empty point.
-
-
-
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:
-
-