java.lang.Object
app.utils.pieceplayer.PieceSocket<M,P>
app.utils.pieceplayer.HotSeatPlayer<M,P>
- All Implemented Interfaces:
Spectator<M,
P>
Creates and controls all game players at once allowing to connect pieces only once
NOTE: If there is a piece belonging to multiple players it will be connected only to one of them
-
Field Summary
FieldsFields inherited from class app.utils.pieceplayer.PieceSocket
newPiece, pieces
-
Constructor Summary
ConstructorsConstructorDescriptionHotSeatPlayer
(GameView<M, P> game, GameSocket<M, P> socket) Create new hot seat player and connect it as a spectator -
Method Summary
Modifier and TypeMethodDescriptionprotected void
connectPiece
(P piece) Connect a single piece and add it to the mapvoid
connectPieces
(Function<P, ? extends InteractivePiece<M, P>> newPiece) Connects underlying game pieces to supplied interactors.Methods inherited from class app.utils.pieceplayer.PieceSocket
update
-
Field Details
-
players
-
-
Constructor Details
-
HotSeatPlayer
Create new hot seat player and connect it as a spectator- Parameters:
game
- view of game that will be playedsocket
- socket that handles interactions
-
-
Method Details
-
connectPieces
Description copied from class:PieceSocket
Connects underlying game pieces to supplied interactors.Implementation should call this method and add newly created piece to the map
- Overrides:
connectPieces
in classPieceSocket<M extends Move<P>,
P extends Piece> - Parameters:
newPiece
- constructor of InteractivePiece that takes P as argument
-
connectPiece
Description copied from class:PieceSocket
Connect a single piece and add it to the map- Specified by:
connectPiece
in classPieceSocket<M extends Move<P>,
P extends Piece>
-