Module app

Class StandalonePiecePlayer<M extends Move<P>,P extends Piece>

java.lang.Object
app.utils.pieceplayer.PieceSocket<M,P>
app.utils.pieceplayer.StandalonePiecePlayer<M,P>
All Implemented Interfaces:
Spectator<M,P>

public final class StandalonePiecePlayer<M extends Move<P>,P extends Piece> extends PieceSocket<M,P>
Wraps single player allowing controlling it with individual pieces
  • Constructor Details

    • StandalonePiecePlayer

      public StandalonePiecePlayer(GameSocket<M,P> socket, int playerId)
  • Method Details

    • connectPieces

      public void connectPieces(Function<P,? extends InteractivePiece<M,P>> newPiece)
      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 class PieceSocket<M extends Move<P>,P extends Piece>
      Parameters:
      newPiece - constructor of InteractivePiece that takes P as argument
    • connectPiece

      protected void connectPiece(P piece)
      Description copied from class: PieceSocket
      Connect a single piece and add it to the map
      Specified by:
      connectPiece in class PieceSocket<M extends Move<P>,P extends Piece>