java.lang.Object
app.chess.Chess
- All Implemented Interfaces:
Game<ChessMove,
,ChessPiece> GameView<ChessMove,
ChessPiece>
Chess kernel that implements behavior of standard chess
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Exception thrown when board state is disturbed -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns all pieces in the gameint
getLegalMoves
(int player) Returns list of moves available for the playergetLegalMoves
(int player, ChessPiece piece) Returns list of moves with given piece available for the playergetPieces
(int player) Returns all pieces that belong to the playerint
Returns number of player this game requiresgetState
(int player) Get current win/lose state of the playerMakes the move as the playervoid
overrideRules
(List<Rule> rules)
-
Field Details
-
SIZE
public static final int SIZE- See Also:
-
board
ChessPiece[][] board
-
-
Constructor Details
-
Chess
-
-
Method Details
-
getPieces
Description copied from interface:GameView
Returns all pieces that belong to the player- Specified by:
getPieces
in interfaceGameView<ChessMove,
ChessPiece>
-
getAllPieces
Description copied from interface:GameView
Returns all pieces in the game- Specified by:
getAllPieces
in interfaceGameView<ChessMove,
ChessPiece>
-
getLegalMoves
Description copied from interface:GameView
Returns list of moves available for the player- Specified by:
getLegalMoves
in interfaceGameView<ChessMove,
ChessPiece>
-
getLegalMoves
Description copied from interface:GameView
Returns list of moves with given piece available for the player- Specified by:
getLegalMoves
in interfaceGameView<ChessMove,
ChessPiece>
-
makeMove
Description copied from interface:Game
Makes the move as the player- Specified by:
makeMove
in interfaceGame<ChessMove,
ChessPiece>
-
getState
Get current win/lose state of the player -
getCurrentPlayer
public int getCurrentPlayer() -
checkIfEnemyKingIsCheckedAfterMove
-
overrideRules
-
getPlayerCount
public int getPlayerCount()Description copied from interface:GameView
Returns number of player this game requires- Specified by:
getPlayerCount
in interfaceGameView<ChessMove,
ChessPiece>
-