Package com.amirhn.GUI
Class ChessController
java.lang.Object
com.amirhn.GUI.ChessController
- All Implemented Interfaces:
ChessMenuController,LocationListener
The type Chess controller.
-
Constructor Summary
ConstructorsConstructorDescriptionChessController(Chess chess, BoardPanel boardPanel) Instantiates a new Chess controller. -
Method Summary
Modifier and TypeMethodDescriptionbooleanApply move boolean.voidApply random move.booleanisLocationDraggable(Location location) Is location draggable boolean.voidloadFEN()Load fen.voidlocationDropped(Location location) Location dropped.voidlocationGrabbed(Location location) Location grabbed.voidlocationSelected(Location location) Location selected.voidnewGame()New game.voidundoMove()Undo move.
-
Constructor Details
-
ChessController
Instantiates a new Chess controller.- Parameters:
chess- the chessboardPanel- the board panel
-
-
Method Details
-
applyRandomMove
public void applyRandomMove()Apply random move.- Specified by:
applyRandomMovein interfaceChessMenuController
-
applyMove
Apply move boolean.- Parameters:
move- the move- Returns:
- the boolean
-
locationSelected
Location selected.- Specified by:
locationSelectedin interfaceLocationListener- Parameters:
location- the location
-
locationGrabbed
Location grabbed.- Specified by:
locationGrabbedin interfaceLocationListener- Parameters:
location- the location
-
locationDropped
Location dropped.- Specified by:
locationDroppedin interfaceLocationListener- Parameters:
location- the location
-
isLocationDraggable
Is location draggable boolean.- Specified by:
isLocationDraggablein interfaceLocationListener- Parameters:
location- the location- Returns:
- the boolean
-
newGame
public void newGame()New game.- Specified by:
newGamein interfaceChessMenuController
-
loadFEN
public void loadFEN()Load fen.- Specified by:
loadFENin interfaceChessMenuController
-
undoMove
public void undoMove()Undo move.- Specified by:
undoMovein interfaceChessMenuController
-