rules
Class Knight
java.lang.Object
core.Piece
rules.Knight
public class Knight
- extends Piece
Knight piece.
Knight
public Knight(Color color,
int lastMove)
getName
protected String getName()
- Specified by:
getName in class Piece
pieceString
public String pieceString()
- Specified by:
pieceString in class Piece
moveCandidates
public Collection<Move> moveCandidates(GameState g,
Position here)
- Specified by:
moveCandidates in class Piece
- See Also:
Piece
threatens
public static boolean threatens(GameState g,
Color c,
Position pos)
- Requires:
- g, from, to != null
- Returns:
- whether any piece of this type and a color
threatens a given position pos.
hashCode
public int hashCode()
- Description copied from class:
Piece
- This should be unique for different pieces or different
colors.
- Specified by:
hashCode in class Piece