- All Known Subinterfaces:
Game<M,
P>
- All Known Implementing Classes:
Checkers
,Chess
,InteractiveGame
,Minesweeper
Interface for retrieving game state
This is separate interface from the game because sometimes we just want to look at the game without modifying it and putting everything in Game would violate Interface Segregation Principle
-
Method Summary
Modifier and TypeMethodDescriptionReturns all pieces in the gamegetLegalMoves
(int player) Returns list of moves available for the playergetLegalMoves
(int player, P 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 requires
-
Method Details
-
getPieces
Returns all pieces that belong to the player -
getAllPieces
Returns all pieces in the game -
getLegalMoves
Returns list of moves available for the player -
getLegalMoves
Returns list of moves with given piece available for the player -
getPlayerCount
int getPlayerCount()Returns number of player this game requires
-