java.lang.Object
app.core.interactor.Player<M,P>
- Direct Known Subclasses:
DumbPlayer
Player exposed to external controllers such as UI, abstracts out player number and underlying game.
Note that player is not a spectator and does not receive updates from game.
Override update method to implement custom behavior
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns all pieces in the gamefinal int
getID()
Returns in-game id of this playerReturns list of available movesgetLegalMoves
(P piece) Returns list of available moves with given pieceReturns all pieces that belong to this playerMakes a move
-
Field Details
-
player
int player -
game
-
-
Constructor Details
-
Player
public Player()
-
-
Method Details
-
getPieces
Returns all pieces that belong to this player -
getAllPieces
Returns all pieces in the game -
getLegalMoves
Returns list of available moves -
getLegalMoves
Returns list of available moves with given piece -
makeMove
Makes a move -
getID
public final int getID()Returns in-game id of this player
-