From 35c4ffd949cfa8403344a871690b7a037d3b5feb Mon Sep 17 00:00:00 2001 From: b0n541 Date: Wed, 18 Nov 2020 19:56:20 +0100 Subject: [PATCH] #82 Show discarded cards as skat instead of dealt skat --- jskat-base/src/main/java/org/jskat/control/SkatGame.java | 2 +- .../src/main/java/org/jskat/control/SkatGameReplayer.java | 5 ++--- .../src/main/java/org/jskat/control/iss/IssController.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/jskat-base/src/main/java/org/jskat/control/SkatGame.java b/jskat-base/src/main/java/org/jskat/control/SkatGame.java index 949533748..7270a3dd4 100644 --- a/jskat-base/src/main/java/org/jskat/control/SkatGame.java +++ b/jskat-base/src/main/java/org/jskat/control/SkatGame.java @@ -1041,7 +1041,7 @@ public void setGameState(GameState newState) { // FIXME: merge this event with the command JSkatEventBus.INSTANCE.post(new TableGameMoveEvent(tableName, new GameFinishEvent(getGameSummary()))); - JSkatEventBus.INSTANCE.post(new ShowCardsCommand(tableName, data.getCardsAfterDiscard(), data.getDealtSkat())); + JSkatEventBus.INSTANCE.post(new ShowCardsCommand(tableName, data.getCardsAfterDiscard(), data.getSkat())); } } } diff --git a/jskat-base/src/main/java/org/jskat/control/SkatGameReplayer.java b/jskat-base/src/main/java/org/jskat/control/SkatGameReplayer.java index f20e11c76..ed9377497 100644 --- a/jskat-base/src/main/java/org/jskat/control/SkatGameReplayer.java +++ b/jskat-base/src/main/java/org/jskat/control/SkatGameReplayer.java @@ -41,8 +41,7 @@ public class SkatGameReplayer { private final List gameMoves = new ArrayList<>(); private int currentMove = 0; - public SkatGameReplayer(JSkatView view, String tableName, - List gameMoves) throws InterruptedException { + public SkatGameReplayer(JSkatView view, String tableName, List gameMoves) { this.view = view; this.tableName = tableName; this.gameMoves.addAll(gameMoves); @@ -110,7 +109,7 @@ private void oneStepForward() { && data.getCurrentTrick().getFirstCard() == null) { JSkatEventBus.TABLE_EVENT_BUSSES.get(tableName).post(new TrickCompletedEvent(data.getLastCompletedTrick())); } else if (event instanceof GameFinishEvent) { - JSkatEventBus.INSTANCE.post(new ShowCardsCommand(tableName, data.getCardsAfterDiscard(), data.getDealtSkat())); + JSkatEventBus.INSTANCE.post(new ShowCardsCommand(tableName, data.getCardsAfterDiscard(), data.getSkat())); } event.processForward(data); diff --git a/jskat-base/src/main/java/org/jskat/control/iss/IssController.java b/jskat-base/src/main/java/org/jskat/control/iss/IssController.java index 23946e69e..0de1c03e1 100644 --- a/jskat-base/src/main/java/org/jskat/control/iss/IssController.java +++ b/jskat-base/src/main/java/org/jskat/control/iss/IssController.java @@ -578,7 +578,7 @@ public void endGame(String tableName, SkatGameData newGameData) { view.setGameState(tableName, GameState.GAME_OVER); // FIXME: merge event and command eventBus.post(new TableGameMoveEvent(tableName, new GameFinishEvent(newGameData.getGameSummary()))); - eventBus.post(new ShowCardsCommand(tableName, newGameData.getCardsAfterDiscard(), newGameData.getDealtSkat())); + eventBus.post(new ShowCardsCommand(tableName, newGameData.getCardsAfterDiscard(), newGameData.getSkat())); gameData.put(tableName, newGameData); }