|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.editev.chess.Chess
|
+--com.editev.chess.piece.Piece
Contains a list of possible piece moves as byte offsets, and encompasses all the rules about legal moves and actually performing the move as an operation on the Game.
the source here.| Inner classes inherited from class com.editev.chess.Chess |
Chess.Black,
Chess.White |
| Field Summary | |
byte[][] |
moves
The moves describe all the possible moves in left-to-right, top-to-bottom order. |
| Fields inherited from class com.editev.chess.Chess |
BLACK,
NO_MOVE,
NO_PIECE,
WHITE |
| Constructor Summary | |
Piece(byte[][] moves)
|
|
| Method Summary | |
byte |
applyMoveToBoard(Move move,
Board board)
Adjust the board's pieces only. |
void |
applyMoveToState(Move move,
GameState game)
Adjust the board's game, which is everything that isn't the board's squares: handles promotions, e.p., castling rules, 50 move rule. |
void |
firstMoveIndex(Move move)
Go to the first move Index. |
byte |
getColumnOffset(Move move)
Convenience function to translate a move's index into a column offset from the move table. |
byte |
getRowOffset(Move move)
Convenience function to translate a move's index into a row offset from the move table. |
boolean |
incrementMoveIndex(Move move)
Go to next possible move. |
boolean |
isCapture(Move move,
Board board)
Is this move a capture on this board? |
boolean |
isIllegal(Move move,
Game game)
Is this illegal because of a piece-specific rule? |
boolean |
isIrreversible(Move move,
Board board)
Is this move irreversible? |
boolean |
moreMoves(Move move)
Any more possible moves? |
boolean |
pieceBetween(Move move,
Board board)
Is there a piece between the "from" and "target" squares? Only the Knight overrides this method. |
void |
setMoveIndex(Move move,
byte index)
Go to a specific move index. |
void |
undoMoveToBoard(Move move,
Board board,
byte captured)
Undo a move, using the piece captured, if any. |
| Methods inherited from class com.editev.chess.Chess |
notColor,
toColor,
toColor,
toColorName |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public final byte[][] moves
| Constructor Detail |
public Piece(byte[][] moves)
| Method Detail |
public boolean pieceBetween(Move move,
Board board)
public byte applyMoveToBoard(Move move,
Board board)
public void undoMoveToBoard(Move move,
Board board,
byte captured)
public void applyMoveToState(Move move,
GameState game)
public void firstMoveIndex(Move move)
public void setMoveIndex(Move move,
byte index)
public boolean incrementMoveIndex(Move move)
public boolean moreMoves(Move move)
public boolean isCapture(Move move,
Board board)
public boolean isIrreversible(Move move,
Board board)
public boolean isIllegal(Move move,
Game game)
public final byte getColumnOffset(Move move)
public final byte getRowOffset(Move move)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||