mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 10:54:51 +00:00
Correct back view
This commit is contained in:
@@ -48,8 +48,6 @@ public final class Server {
|
|||||||
|
|
||||||
private ScheduledExecutorService scheduler;
|
private ScheduledExecutorService scheduler;
|
||||||
|
|
||||||
private EventFlow eventFlow = new EventFlow();
|
|
||||||
|
|
||||||
public static GameInformation.Type gameToType(String game) {
|
public static GameInformation.Type gameToType(String game) {
|
||||||
if (game.equalsIgnoreCase("tic-tac-toe")) {
|
if (game.equalsIgnoreCase("tic-tac-toe")) {
|
||||||
return GameInformation.Type.TICTACTOE;
|
return GameInformation.Type.TICTACTOE;
|
||||||
@@ -98,9 +96,8 @@ public final class Server {
|
|||||||
);
|
);
|
||||||
|
|
||||||
loading.setOnFailure(() -> {
|
loading.setOnFailure(() -> {
|
||||||
WidgetContainer.getCurrentView().transitionPrevious();
|
if (WidgetContainer.getCurrentView() == loading) WidgetContainer.getCurrentView().transitionPrevious();
|
||||||
a.unsubscribe("connecting");
|
a.unsubscribeAll();
|
||||||
a.unsubscribe("startclient");
|
|
||||||
WidgetContainer.add(
|
WidgetContainer.add(
|
||||||
Pos.CENTER,
|
Pos.CENTER,
|
||||||
new ErrorPopup(AppContext.getString("connecting-failed") + " " + ip + ":" + port)
|
new ErrorPopup(AppContext.getString("connecting-failed") + " " + ip + ":" + port)
|
||||||
@@ -147,11 +144,11 @@ public final class Server {
|
|||||||
)
|
)
|
||||||
.postEvent();
|
.postEvent();
|
||||||
|
|
||||||
eventFlow.listen(NetworkEvents.ChallengeResponse.class, this::handleReceivedChallenge, false)
|
a.listen(NetworkEvents.ChallengeResponse.class, this::handleReceivedChallenge, false, "challenge")
|
||||||
.listen(NetworkEvents.GameMatchResponse.class, this::handleMatchResponse, false)
|
.listen(NetworkEvents.GameMatchResponse.class, this::handleMatchResponse, false, "match-response")
|
||||||
.listen(NetworkEvents.GameResultResponse.class, this::handleGameResult, false)
|
.listen(NetworkEvents.GameResultResponse.class, this::handleGameResult, false, "game-result")
|
||||||
.listen(NetworkEvents.GameMoveResponse.class, this::handleReceivedMove, false)
|
.listen(NetworkEvents.GameMoveResponse.class, this::handleReceivedMove, false, "game-move")
|
||||||
.listen(NetworkEvents.YourTurnResponse.class, this::handleYourTurn, false);
|
.listen(NetworkEvents.YourTurnResponse.class, this::handleYourTurn, false, "your-turn");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendChallenge(String opponent) {
|
private void sendChallenge(String opponent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user