java.lang.Object
app.checkers.Checkers
- All Implemented Interfaces:
Game<CheckersMove,
,CheckersPiece> GameView<CheckersMove,
CheckersPiece>
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) CheckersPiece[][]
(package private) CheckersPiece
(package private) List<CheckersPiece>
(package private) List<CheckersPiece>
(package private) int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
canAnyCapture
(int player) (package private) boolean
(package private) Field
capturingMove
(CheckersPiece piece, int dirX, int dirY) (package private) List<CheckersMove>
capturingMoves
(CheckersPiece piece) Returns all pieces in the gameint
getLegalMoves
(int player) Returns list of moves available for the playergetLegalMoves
(int player, CheckersPiece piece) Returns list of moves with given piece available for the player(package private) CheckersPiece
getPieces
(int player) Returns all pieces that belong to the playerint
Returns number of player this game requires(package private) boolean
(package private) List<CheckersPiece>
makeMove
(int player, CheckersMove move) Makes the move as the player(package private) List<CheckersMove>
normalMoves
(CheckersPiece piece) (package private) void
setPiece
(Field field, CheckersPiece piece) (package private) List<CheckersMove>
(package private) List<CheckersMove>
upgradedCapturingMoves
(CheckersPiece piece, int dirX, int dirY) (package private) List<CheckersMove>
upgradedMoves
(CheckersPiece piece) (package private) List<CheckersMove>
upgradedMoves
(CheckersPiece piece, int dirX, int dirY)
-
Field Details
-
board
CheckersPiece[][] board -
player0pieces
List<CheckersPiece> player0pieces -
player1pieces
List<CheckersPiece> player1pieces -
forcedPiece
CheckersPiece forcedPiece -
turn
int turn
-
-
Constructor Details
-
Checkers
public Checkers()
-
-
Method Details
-
makeMove
Description copied from interface:Game
Makes the move as the player- Specified by:
makeMove
in interfaceGame<CheckersMove,
CheckersPiece>
-
getCurrentPlayer
public int getCurrentPlayer() -
getPieces
Description copied from interface:GameView
Returns all pieces that belong to the player- Specified by:
getPieces
in interfaceGameView<CheckersMove,
CheckersPiece>
-
getAllPieces
Description copied from interface:GameView
Returns all pieces in the game- Specified by:
getAllPieces
in interfaceGameView<CheckersMove,
CheckersPiece>
-
getLegalMoves
Description copied from interface:GameView
Returns list of moves available for the player- Specified by:
getLegalMoves
in interfaceGameView<CheckersMove,
CheckersPiece>
-
getLegalMoves
Description copied from interface:GameView
Returns list of moves with given piece available for the player- Specified by:
getLegalMoves
in interfaceGameView<CheckersMove,
CheckersPiece>
-
capturingMove
-
killAll
-
upgradedMoves
-
getResult
-
upgradedMoves
-
upgradedCapturingMoves
-
upgradedCapturingMoves
-
normalMoves
-
capturingMoves
-
canAnyCapture
boolean canAnyCapture(int player) -
canMove
-
getPiece
-
setPiece
-
isFieldValid
-
getPlayerCount
public int getPlayerCount()Description copied from interface:GameView
Returns number of player this game requires- Specified by:
getPlayerCount
in interfaceGameView<CheckersMove,
CheckersPiece>
-