mixmeta4
Class Knight
java.lang.Object
mixmeta4.Piece
mixmeta4.Knight
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class Knight
- extends Piece
Knight (N,n) moves in an "L" shape, two squares either vertically or
horizontally, then one square horizontally or vertically, respectively.
It can jump over other pieces in its path.
- See Also:
- Serialized Form
Constructor Summary |
Knight(boolean isRed,
boolean visible)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
RED_DIRECTIONS
public static java.awt.Point[] RED_DIRECTIONS
BLACK_DIRECTIONS
public static java.awt.Point[] BLACK_DIRECTIONS
Knight
public Knight(boolean isRed,
boolean visible)
clone
public java.lang.Object clone()
- Overrides:
clone
in class Piece
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class Piece