model.moves
Class Capture

java.lang.Object
  extended by model.moves.Move
      extended by model.moves.Capture

public class Capture
extends Move

Represents a move that captures an opposite piece.


Constructor Summary
Capture(Cell a, Cell b, Piece r)
          constructor: Creates a new Capture move.
 
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 model.moves.Move
equals, getFrom, getTo, move
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Cell
b - destination Cell
r - piece captivated
Method Detail

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.