Package com.amirhn.Pieces
Class King
java.lang.Object
com.amirhn.Pieces.Piece
com.amirhn.Pieces.King
The type King.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canBeCapturedBy
(Piece piece) Can be captured by boolean.getNaturalMoves
(Board board) Gets natural moves.getThreatenedLocations
(Board board) Gets threatened locations.Methods inherited from class com.amirhn.Pieces.Piece
copy, equals, generate, generate, getAllowedMoves, getLocation, getSymbol, hashCode, hasMoved, isAllowedToMove, removeLocation, setLocation, setLocationBack, toString
-
Constructor Details
-
King
Instantiates a new King.- Parameters:
color
- the colorlocation
- the location
-
-
Method Details
-
canBeCapturedBy
Can be captured by boolean.- Overrides:
canBeCapturedBy
in classPiece
- Parameters:
piece
- the piece- Returns:
- the boolean
-
getThreatenedLocations
Gets threatened locations.- Specified by:
getThreatenedLocations
in classPiece
- Parameters:
board
- the board- Returns:
- the threatened locations
-
getNaturalMoves
Gets natural moves.- Overrides:
getNaturalMoves
in classPiece
- Parameters:
board
- the board- Returns:
- the natural moves
-