model.moves
Class Capture
java.lang.Object
model.moves.Move
model.moves.Capture
public class Capture
- extends Move
Represents a move that captures an opposite piece.
|
Method Summary |
void |
prev(ChessBoard x)
transformer(mutative): Takes the chess board a move back. |
java.lang.String |
toString()
accessor(selector): Creates a String representation of the
Capture move. |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Capture
public Capture(Cell a,
Cell b,
Piece r)
- constructor: Creates a new Capture move. The parameters are the
source and destionation Cell(s) of the capture and the captured Piece.
postcondition: Creates a new Capture move based on the parameters.
The source(a) and destination(b) Cell(s) which are needed to describe the move
and the Piece(r) captivated.
- Parameters:
a - source Cellb - destination Cellr - piece captivated
prev
public void prev(ChessBoard x)
- transformer(mutative): Takes the chess board a move back.
postcondition: Does the reverse Capture Move.
- Overrides:
prev in class Move
- Parameters:
x - is the ChessBoard that the changes will be applied.
toString
public java.lang.String toString()
- accessor(selector): Creates a String representation of the
Capture move.
postcondition: Creates a String display of Capture.
- Overrides:
toString in class Move
- Returns:
- A string display the Capture Move.