rules
Class StraightPiece

java.lang.Object
  extended by core.Piece
      extended by rules.StraightPiece
Direct Known Subclasses:
Bishop, Queen, Rook

public abstract class StraightPiece
extends Piece

Common superclass of bishop, rook, and queen (which all have similar movement). Immutable.

Specification Fields

Field Summary
protected  boolean[] goodSum
           
 
Fields inherited from class core.Piece
color
 
Constructor Summary
StraightPiece(Color color, int lastMove, boolean oneGood, boolean twoGood)
           
 
Method Summary
protected abstract  StraightPiece constructor(Color color, int lastMove)
           
 boolean getGoodSum(int i)
           
 Collection<Move> moveCandidates(GameState g, Position here)
           
static boolean threatens(GameState g, Color color, Position pos)
           
 
Methods inherited from class core.Piece
getColor, getLastMove, getName, hashCode, pieceString, postMove, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

goodSum

protected boolean[] goodSum
Constructor Detail

StraightPiece

public StraightPiece(Color color,
                     int lastMove,
                     boolean oneGood,
                     boolean twoGood)
Method Detail

getGoodSum

public boolean getGoodSum(int i)

constructor

protected abstract StraightPiece constructor(Color color,
                                             int lastMove)

moveCandidates

public Collection<Move> moveCandidates(GameState g,
                                       Position here)
Specified by:
moveCandidates in class Piece
See Also:
Piece

threatens

public static boolean threatens(GameState g,
                                Color color,
                                Position pos)
See Also:
Piece