rules
Class PieceFactory

java.lang.Object
  extended by rules.PieceFactory

public class PieceFactory
extends Object

Go from a piece name to a piece instance.


Constructor Summary
PieceFactory()
           
 
Method Summary
static Piece newPiece(Piece p)
           
static Piece newPiece(Piece p, int num)
          Copy a piece, with a new lastMove.
static Piece pieceFromChar(char s)
          Go from a short name to a piece, lowercase = black.
static Piece pieceFromChar(char s, int num)
          Go from a short name to a piece, lowercase = black.
static Piece pieceFromString(String piece, Color p)
          Go from a long name to a piece.
static Piece pieceFromString(String piece, Color p, int num)
          Go from a long name to a piece.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PieceFactory

public PieceFactory()
Method Detail

newPiece

public static Piece newPiece(Piece p,
                             int num)
Copy a piece, with a new lastMove.

Requires:
p != null

newPiece

public static Piece newPiece(Piece p)

pieceFromChar

public static Piece pieceFromChar(char s)
Go from a short name to a piece, lowercase = black. Lastmove is set to 0.


pieceFromChar

public static Piece pieceFromChar(char s,
                                  int num)
Go from a short name to a piece, lowercase = black. Lastmove is specified.


pieceFromString

public static Piece pieceFromString(String piece,
                                    Color p)
Go from a long name to a piece. Lastmove is set to 0.

Requires:
piece != null && p != null

pieceFromString

public static Piece pieceFromString(String piece,
                                    Color p,
                                    int num)
Go from a long name to a piece. Lastmove is specified.

Requires:
piece != null && p != null