|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.game.boardgame.chess.action.ChessActionComparator
public class ChessActionComparator
Provides a Comparator to order chess actions. The action order
is hopefully useful to the alpha-beta forward search algorithm, with capture
moves first.
| Constructor Summary | |
|---|---|
ChessActionComparator(IChessEnvironment board)
Construct this object with the given parameter. |
|
| Method Summary | |
|---|---|
int |
compare(Object object0,
Object object1)
Return -1, 0, 1 if object0 is less than, equal to, or greater than object1. |
protected int |
compareActionClass(Class class0,
Class class1)
Sort the action class in this order: PawnPromotionCaptureAction MoveCaptureAction EnPassantCaptureAction PawnPromotionAction MoveAction CastleAction |
protected int |
compareTokenClass(Class class0,
Class class1)
Sort the token class in this order: IQueen IRook IKnight IBishop IPawn IMace IKing |
void |
setBoard(IChessEnvironment board)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Constructor Detail |
|---|
public ChessActionComparator(IChessEnvironment board)
board - Chess environment. (required)| Method Detail |
|---|
public int compare(Object object0,
Object object1)
compare in interface Comparatorpublic void setBoard(IChessEnvironment board)
board - The board to set.
protected int compareActionClass(Class class0,
Class class1)
class0 - First class.class1 - Second class.
protected int compareTokenClass(Class class0,
Class class1)
class0 - First class.class1 - Second class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |