|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmodel.pieces.Piece
public abstract class Piece
Represents a Piece in the chess board.
| Constructor Summary | |
|---|---|
Piece(java.lang.String pieceName,
boolean what,
javax.swing.Icon icon)
This constructor is used by all the subclasses of Piece. |
|
| Method Summary | |
|---|---|
boolean |
getColor()
accessor(selector): Returns the Color of the given Piece. |
javax.swing.Icon |
getIcon()
accessor(selector): Returns an icon of the Piece. |
java.lang.String |
getName()
accessor(selector): Returns the name of the given Piece. |
abstract java.util.List<Move> |
moves(Cell x,
ChessBoard z)
Finds and returns all the possible moves of the Piece in the given Cell, in the given ChessBoard. |
void |
setIcon(javax.swing.Icon r)
transformer(mutative): Changes the Icon of the given piece with the one passed as parameter. |
void |
setName(java.lang.String x)
transformer(mutative): Changes the Piece's name to the String passed as parameter. |
java.lang.String |
toString()
accessor(selector): Returns a String representation of a Piece. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Piece(java.lang.String pieceName,
boolean what,
javax.swing.Icon icon)
throws java.lang.IllegalArgumentException
pieceName - the String name of the piecewhat - the Color the given piece will haveicon - the Icon this piece will have
IllegalArgument - exception if pieceName parameter is empty or null.
java.lang.IllegalArgumentException| Method Detail |
|---|
public boolean getColor()
public abstract java.util.List<Move> moves(Cell x,
ChessBoard z)
x - Piece's current Cellz - ChessBoard where the Cell can be found
public void setIcon(javax.swing.Icon r)
r - Icon to be set to.public javax.swing.Icon getIcon()
public void setName(java.lang.String x)
throws java.lang.NullPointerException,
java.lang.IllegalArgumentException
x - String Parameter to alter Player's name to.
java.lang.NullPointerException - If String argument x is null.
java.lang.IllegalArgumentException - If the String is emptypublic java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||