com.editev.chess.piece
Class Rook

java.lang.Object
  |
  +--com.editev.chess.Chess
        |
        +--com.editev.chess.piece.Piece
              |
              +--com.editev.chess.piece.Rook

public class Rook
extends Piece

Once a Rook has moved, it may no longer castle, but otherwise has no specific rules.

See Also:
the source here.

Inner classes inherited from class com.editev.chess.Chess
Chess.Black, Chess.White
 
Field Summary
static byte[][] MOVES
          An array of all the possible Rook moves as byte offsets.
static Rook PIECE
          The unique/singleton instantiation of Rook.
 
Fields inherited from class com.editev.chess.piece.Piece
moves
 
Fields inherited from class com.editev.chess.Chess
BLACK, NO_MOVE, NO_PIECE, WHITE
 
Constructor Summary
private Rook()
          This class is a singleton, so the constructor is private.
 
Method Summary
 void applyMoveToState(Move move, GameState game)
          If you move a rook, you can no longer castle with that rook -- the GameState must reflect this.
 
Methods inherited from class com.editev.chess.piece.Piece
applyMoveToBoard, firstMoveIndex, getColumnOffset, getRowOffset, incrementMoveIndex, isCapture, isIllegal, isIrreversible, moreMoves, pieceBetween, setMoveIndex, undoMoveToBoard
 
Methods inherited from class com.editev.chess.Chess
notColor, toColor, toColor, toColorName
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MOVES

public static final byte[][] MOVES
An array of all the possible Rook moves as byte offsets.

PIECE

public static final Rook PIECE
The unique/singleton instantiation of Rook.
Constructor Detail

Rook

private Rook()
This class is a singleton, so the constructor is private.
Method Detail

applyMoveToState

public void applyMoveToState(Move move,
                             GameState game)
If you move a rook, you can no longer castle with that rook -- the GameState must reflect this.
Overrides:
applyMoveToState in class Piece