Skip to content

Commit

Permalink
#82 Show discarded cards as skat instead of dealt skat
Browse files Browse the repository at this point in the history
  • Loading branch information
b0n541 committed Nov 18, 2020
1 parent 778d08e commit 35c4ffd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jskat-base/src/main/java/org/jskat/control/SkatGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ public class SkatGameReplayer {
private final List<SkatGameEvent> gameMoves = new ArrayList<>();
private int currentMove = 0;

public SkatGameReplayer(JSkatView view, String tableName,
List<SkatGameEvent> gameMoves) throws InterruptedException {
public SkatGameReplayer(JSkatView view, String tableName, List<SkatGameEvent> gameMoves) {
this.view = view;
this.tableName = tableName;
this.gameMoves.addAll(gameMoves);
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 35c4ffd

Please sign in to comment.