de.java_chess.javaChess.ply
Class PlyImpl

java.lang.Object
  |
  +--de.java_chess.javaChess.ply.PlyImpl
Direct Known Subclasses:
CastlingPlyImpl, EnPassantPlyImpl, TransformationPlyImpl

public class PlyImpl
extends java.lang.Object
implements Ply

This class implements the functionality of a ply.


Constructor Summary
PlyImpl(Position source, Position destination)
          Construct a new ply from a source and a destination.
 
Method Summary
 boolean equals(Ply ply)
          Test, if this ply is equal to another ply.
 Position getDestination()
          Get the destination of the piece.
 Position getSource()
          Get the source of the ply.
 void setDestination(Position destination)
          Set the destination of the piece.
 void setSource(Position source)
          Set the source of the ply.
 java.lang.String toString()
          Convert the ply into something human readable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlyImpl

public PlyImpl(Position source,
               Position destination)
Construct a new ply from a source and a destination.
Parameters:
source - The source of the ply.
destination - The destination of the ply.
Method Detail

getSource

public final Position getSource()
Get the source of the ply.
Specified by:
getSource in interface Ply
Returns:
The source of the piece.

setSource

public final void setSource(Position source)
Set the source of the ply.
Specified by:
setSource in interface Ply
Parameters:
The - new source of the piece.

getDestination

public final Position getDestination()
Get the destination of the piece.
Specified by:
getDestination in interface Ply
Returns:
The destination of the piece.

setDestination

public final void setDestination(Position destination)
Set the destination of the piece.
Specified by:
setDestination in interface Ply
Parameters:
destination - The new destination of the piece.

toString

public java.lang.String toString()
Convert the ply into something human readable. It's not exactly chess notation, since we don't have a board to check, if it is a move or a attack.
Overrides:
toString in class java.lang.Object
Returns:
The ply as a string.

equals

public final boolean equals(Ply ply)
Test, if this ply is equal to another ply.
Specified by:
equals in interface Ply
Parameters:
ply - The other ply.
Returns:
true, if the 2 plies are equal.