|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object chess.ChessPiece
public class ChessPiece
Constructor Summary | |
---|---|
ChessPiece()
Creates a new instance of ChessPiece. | |
ChessPiece(Color col,
Piece pc)
Creates a new instance of ChessPiece. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
report whether two chess pieces have equivalent contents |
Color |
getColor()
report piece's Color using enum type |
Piece |
getPiece()
report piece's type using enum type |
int |
getValue()
report value of piece - based solely on its type |
int |
getValue(Color perspective)
report value of piece - based solely on its type - but from the perspective of a particular color. |
boolean |
isEmpty()
reports whether piece is an empty space. |
void |
setColor(Color col)
change pieces color. |
void |
setPiece(Piece pc)
change pieces type. |
boolean |
switchColor()
|
java.lang.String |
toShortString()
report what a piece is in a short string - for presenting a whole board |
java.lang.String |
toString()
report what the piece is in a nice string |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait,
wait, wait |
Constructor Detail |
---|
public ChessPiece()
public ChessPiece(Color col, Piece pc)
Method Detail |
---|
public Color getColor()
public Piece getPiece()
public int getValue()
public int getValue(Color perspective)
public boolean isEmpty()
public void setColor(Color col)
public boolean switchColor()
public void setPiece(Piece pc)
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 java.lang.String toShortString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |