|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmodel.moves.Move
public class Move
Represents a move on the chessboard.
| Constructor Summary | |
|---|---|
Move(Cell a,
Cell b)
constructor: Creates a Move based on the two given cells. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object other)
accessor(observer): Returns a boolean value on whether the object passed as parameter is equal with the object it is called from. |
Cell |
getFrom()
accessor(selector): Returns the source cell of the given Move. |
Cell |
getTo()
accessor(selector): Returns the destination cell of the given Move. |
boolean |
move(ChessBoard x)
Given a ChessBoard and a Move(this), applies the given Move on the chess board. |
void |
prev(ChessBoard x)
Given a ChessBoard performs a reverse Move. |
java.lang.String |
toString()
accessor(selector): Returns the String representation of the given move. |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Move(Cell a,
Cell b)
throws IllegalCellException
a - source cellb - destination cell
IllegalCellException - if Cell(s) don't correspond to valid Cell(s) or
are equal.Cell| Method Detail |
|---|
public Cell getFrom()
public Cell getTo()
public boolean move(ChessBoard x)
x - the ChessBoard that the Move is applied on.
public void prev(ChessBoard x)
x - ChessBoard that previous Move is applied on.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - Object to be compared with
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||