public class AbstractClient implements ILobbyClientListener
Eine abstrakte Implementation des interface ILobbyClientListener
.
Hier sind alle Methoden implementiert, die unabhängig von der Logik der Clients der Spieler sind.
interface ILobbyClientListener
public AbstractClient(@NotNull java.lang.String host, int port)
Eine abstrakte Implementation des interface ILobbyClientListener
.
Hier sind alle Methoden implementiert, die unabhängig von der Logik der Clients der Spieler sind.
interface ILobbyClientListener
public boolean isGameOver()
public void setGameOver(boolean p)
@Nullable protected IGameHandler getHandler()
The handler reacts to messages from the server received by the lobby client.
protected void setHandler(@Nullable IGameHandler p)
The handler reacts to messages from the server received by the lobby client.
@Nullable public java.lang.String getError()
Storage for the reason of a rule violation, if any occurs.
@Nullable public Team getTeam()
The team the client belongs to. Needed to connect client and player.
@NotNull public IControllableGame observeGame(@NotNull GamePreparedResponse handle)
Tell this client to observe the game given by the preparation handler.
public void onRoomMessage(@NotNull java.lang.String roomId, @NotNull ProtocolMessage data)
Called for any new message sent to the game room, e.g., move requests.
public void sendMove(@NotNull Move move)
Sends the selected move to the server.
public void onError(@NotNull java.lang.String roomId, @NotNull ProtocolErrorMessage error)
Called when an erroneous message is sent to the room.
public void onNewState(@NotNull java.lang.String roomId, @NotNull IGameState state)
Called when game state has been received. Happens after a client made a move.
public void joinAnyGame()
start and join any game with the appropriate gameType.
public void onGameJoined(@NotNull java.lang.String roomId)
public void onGamePrepared(@NotNull GamePreparedResponse response)
public void onGamePaused(@NotNull java.lang.String roomId, @NotNull Player nextPlayer)
public void onGameObserved(@NotNull java.lang.String roomId)
public void onGameLeft(@NotNull java.lang.String roomId)
public void onGameOver(@NotNull java.lang.String roomId, @NotNull GameResult data)
public void joinPreparedGame(@NotNull java.lang.String reservation)