de.java_chess.javaChess.ply
Class CastlingPlyImpl
java.lang.Object
|
+--de.java_chess.javaChess.ply.PlyImpl
|
+--de.java_chess.javaChess.ply.CastlingPlyImpl
- public class CastlingPlyImpl
- extends PlyImpl
- implements CastlingPly
This class represents a castling.
Constructor Summary |
CastlingPlyImpl(Position source,
boolean goesLeft)
Construct a new castling ply from a source and a destination
and the direction. |
Method Summary |
boolean |
isLeftCastling()
Check, if this castling goes to the left side of the board. |
void |
setLeftCastling(boolean goesLeft)
Set the flag, if the castling goes left. |
java.lang.String |
toString()
Get a string representation of this castling. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
CastlingPlyImpl
public CastlingPlyImpl(Position source,
boolean goesLeft)
- Construct a new castling ply from a source and a destination
and the direction.
- Parameters:
source
- The source of the ply.destination
- The destination of the ply.goesLeft
- Flag to indicate if the castling goes left.
isLeftCastling
public final boolean isLeftCastling()
- Check, if this castling goes to the left side of the board.
- Specified by:
- isLeftCastling in interface CastlingPly
- Returns:
- true, if the castling goes to the left side, false otherwise.
setLeftCastling
public final void setLeftCastling(boolean goesLeft)
- Set the flag, if the castling goes left.
- Specified by:
- setLeftCastling in interface CastlingPly
- Parameters:
goesLeft
- Flag to indicate if the castling goes left.
toString
public final java.lang.String toString()
- Get a string representation of this castling.
- Overrides:
- toString in class PlyImpl
- Returns:
- A string representation of this ply.