|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--chessThreaded.ChessPiece
Constructor Summary | |
ChessPiece()
Creates a new instance of ChessPiece |
|
ChessPiece(char col,
java.lang.String pc)
Creates a new instance of ChessPiece if any problems, make it empty |
Method Summary | |
boolean |
empty()
report whether a piece is really an empty space |
boolean |
equals(java.lang.Object obj)
determine if two chess pieces are equal valued |
char |
getColor()
|
java.lang.String |
getPiece()
|
int |
getValue()
report an estimated value of a piece - very rough - never beat Kasparov with this |
static void |
main(java.lang.String[] args)
Used for testing pieces class - kinda sparse test right now |
boolean |
setColor(char col)
change value for a pieces color - indicate failure if bad value passed |
boolean |
setPiece(java.lang.String pc)
change value for a pieces type - indicate failure if bad value passed |
java.lang.String |
toString()
make ready for presentation an empty piece is shown as blank |
static boolean |
validColor(char col)
static method to determine if a potential piece color is a valid piece color |
static boolean |
validPieceType(java.lang.String pc)
static method to determine if a potential piece type is a valid piece type |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ChessPiece()
public ChessPiece(char col, java.lang.String pc)
Method Detail |
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public char getColor()
public java.lang.String getPiece()
public int getValue()
public boolean empty()
public static boolean validPieceType(java.lang.String pc)
public static boolean validColor(char col)
public boolean setColor(char col)
public boolean setPiece(java.lang.String pc)
public static void main(java.lang.String[] args)
args
- the command line arguments
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |