Package jadex.bdiv3.examples.puzzle
Class MoveComparator
- java.lang.Object
-
- jadex.bdiv3.examples.puzzle.MoveComparator
-
-
Field Summary
Fields Modifier and Type Field Description protected IBoardboardThe board (required for checking which piece is in a given position).protected java.lang.StringstrategyThe strategy.static java.lang.StringSTRATEGY_ALTER_LONGThe strategy preferring jump moves of different colors.static java.lang.StringSTRATEGY_LONGThe strategy preferring jump moves, but ignoring colors.static java.lang.StringSTRATEGY_NONENo strategy: try moves in order of appearance.static java.lang.StringSTRATEGY_SAME_LONGThe strategy preferring jump moves of same color.
-
Constructor Summary
Constructors Constructor Description MoveComparator(IBoard board, java.lang.String strategy)Create a move comparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Move move1, Move move2)Compare two moves.
-
-
-
Field Detail
-
STRATEGY_NONE
public static final java.lang.String STRATEGY_NONE
No strategy: try moves in order of appearance.- See Also:
- Constant Field Values
-
STRATEGY_LONG
public static final java.lang.String STRATEGY_LONG
The strategy preferring jump moves, but ignoring colors.- See Also:
- Constant Field Values
-
STRATEGY_SAME_LONG
public static final java.lang.String STRATEGY_SAME_LONG
The strategy preferring jump moves of same color.- See Also:
- Constant Field Values
-
STRATEGY_ALTER_LONG
public static final java.lang.String STRATEGY_ALTER_LONG
The strategy preferring jump moves of different colors.- See Also:
- Constant Field Values
-
board
protected IBoard board
The board (required for checking which piece is in a given position).
-
strategy
protected java.lang.String strategy
The strategy.
-
-
Constructor Detail
-
MoveComparator
public MoveComparator(IBoard board, java.lang.String strategy)
Create a move comparator.
-
-