|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmodel.pieces.Piece
model.pieces.Rook
public class Rook
Represents the Rook piece
| Constructor Summary | |
|---|---|
Rook(java.lang.String x,
boolean z,
javax.swing.Icon r)
constructor: Constructs a new Rook piece, with color based on the parameter z(white for true, black for false) and name based on the parameter x and the Icon(parameter r). |
|
| Method Summary | |
|---|---|
void |
hasMoved()
transformer(mutative): Notifies that the Rook has moved, thus making it impossible in the future to execute a castling move. |
void |
hasMoved(boolean what)
transformer(mutative): Changes the info if the Rook has moved, thus making it impossible in the future to take place in a castling move. |
boolean |
isMoved()
accessor(selector): Tells us whether the Rook has moved or not. |
java.util.List<Move> |
moves(Cell p,
ChessBoard b)
Creates and returns a List of all the possible Moves the Rook can execute. |
java.lang.String |
toString()
accessor(selector): Returns a String representation of the Rook. |
| Methods inherited from class model.pieces.Piece |
|---|
getColor, getIcon, getName, setIcon, setName |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Rook(java.lang.String x,
boolean z,
javax.swing.Icon r)
r - Defines the icon of the Rook.x - Defines the name of the Rook.z - Defines the color of the Rook. White for true, black for false.| Method Detail |
|---|
public void hasMoved()
Castlingpublic void hasMoved(boolean what)
what - boolean showing wether given rook has moved or not.Castlingpublic boolean isMoved()
public java.util.List<Move> moves(Cell p,
ChessBoard b)
moves in class Piecep - Is the Cell of the Rook which the moves we want to find.b - The ChessBoard on which the Rook's moves are found.
public java.lang.String toString()
toString in class Piece
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||