model.moves
Class Castling

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

public class Castling
extends Move

Represents the move of the small and great castling


Constructor Summary
Castling(Cell from, Cell to)
          constructor: Creates a new Castling move, using destination and source Cell(s) as parameters.
 
Method Summary
 boolean move(ChessBoard x)
          transformer(mutative): Applies a Castling move on the given ChessBoard.
 void prev(ChessBoard x)
          transformer(mutative): Takes the ChessBoard a move back.
 java.lang.String toString()
          accessor(selector): Creates a String representation of the Castling move.
 
Methods inherited from class model.moves.Move
equals, getFrom, getTo
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Castling

public Castling(Cell from,
                Cell to)
constructor: Creates a new Castling move, using destination and source Cell(s) as parameters.
postcondition: Creates a new Castling move.

Parameters:
from - source Cell.
to - destination Cell.
Method Detail

move

public boolean move(ChessBoard x)
transformer(mutative): Applies a Castling move on the given ChessBoard.
postcondition: A Castling move is applied on the ChessBoard.

Overrides:
move in class Move
Parameters:
x - Is the ChessBoard the changes will be applied.
Returns:
true if changes the move is successful, false otherwise.

prev

public void prev(ChessBoard x)
transformer(mutative): Takes the ChessBoard a move back.
postcondition: Does the reverse of the Castling Move, goes from destination to source.

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 Castling move.
postcondition:Creates a String display of Castling.

Overrides:
toString in class Move
Returns:
A string to show Castling.