java.lang.Object
app.utils.pieceplayer.PieceSocket<M,P>
- Type Parameters:
M
-P
-
- All Implemented Interfaces:
Spectator<M,
P>
- Direct Known Subclasses:
HotSeatPlayer
,PieceSpectator
,StandalonePiecePlayer
public abstract class PieceSocket<M extends Move<P>,P extends Piece>
extends Object
implements Spectator<M,P>
Socket for interacting with game using individual pieces.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract 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.final void
Updates all interactive pieces connected to the changed pieces
-
Field Details
-
pieces
-
newPiece
-
-
Constructor Details
-
PieceSocket
public PieceSocket()
-
-
Method Details
-
update
Updates all interactive pieces connected to the changed pieces -
connectPieces
Connects underlying game pieces to supplied interactors.Implementation should call this method and add newly created piece to the map
- Parameters:
newPiece
- constructor of InteractivePiece that takes P as argument
-
connectPiece
Connect a single piece and add it to the map
-