This commit is contained in:
Felix Koppe
2024-11-30 13:12:51 +01:00
parent a78b3acacd
commit 6f71a8b16d
2 changed files with 20 additions and 20 deletions

View File

@@ -12,7 +12,7 @@ public class MdgaApp extends SimpleApplication {
private AcousticHandler acousticHandler;
private NotificationSynchronizer notificationSynchronizer;
private InputSynchronizer inputSynchronizer;
private ModelSyncronizer modelSyncronizer;
private ModelSynchronizer modelSynchronizer;
MdgaView view = null;
private MdgaState state = null;
@@ -50,7 +50,7 @@ public void simpleInitApp() {
acousticHandler = new AcousticHandler(this);
notificationSynchronizer = new NotificationSynchronizer(this);
inputSynchronizer = new InputSynchronizer(this);
modelSyncronizer = new ModelSyncronizer(this);
modelSynchronizer = new ModelSynchronizer(this);
mainView = new MainView(this);
lobbyView = new LobbyView(this);
@@ -114,8 +114,8 @@ public MdgaView getView() {
return view;
}
public ModelSyncronizer getModelSyncronizer() {
return modelSyncronizer;
public ModelSynchronizer getModelSyncronizer() {
return modelSynchronizer;
}
public InputSynchronizer getInputSyncronizer() { return inputSynchronizer; }

View File

@@ -79,29 +79,29 @@ private void handleGame(Notification notification) {
// Handle AcquireCardNotification
} else if (notification instanceof ActivePlayerNotification n) {
gameView.getGuiHandler().setActivePlayer(n.getColor());
} else if (notification instanceof CeremonyNotification) {
} else if (notification instanceof CeremonyNotification ceremonyNotification) {
app.enter(MdgaState.CEREMONY);
CeremonyView ceremonyView = (CeremonyView) app.getView();
int size = n.getNames().size();
int size = ceremonyNotification.getNames().size();
if (n.getPiecesThrown().size() != size ||
n.getPiecesLost().size() != size ||
n.getBonusCardsPlayed().size() != size ||
n.getSixes().size() != size ||
n.getNodesMoved().size() != size ||
n.getBonusNodes().size() != size) {
if (ceremonyNotification.getPiecesThrown().size() != size ||
ceremonyNotification.getPiecesLost().size() != size ||
ceremonyNotification.getBonusCardsPlayed().size() != size ||
ceremonyNotification.getSixes().size() != size ||
ceremonyNotification.getNodesMoved().size() != size ||
ceremonyNotification.getBonusNodes().size() != size) {
throw new IllegalArgumentException("All data lists in CeremonyNotification must have the same size.");
}
for (int i = 0; i < size; i++) {
Color color = n.getColors().get(i);
String name = n.getNames().get(i);
int v1 = n.getPiecesThrown().get(i);
int v2 = n.getPiecesLost().get(i);
int v3 = n.getBonusCardsPlayed().get(i);
int v4 = n.getSixes().get(i);
int v5 = n.getNodesMoved().get(i);
int v6 = n.getBonusNodes().get(i);
Color color = ceremonyNotification.getColors().get(i);
String name = ceremonyNotification.getNames().get(i);
int v1 = ceremonyNotification.getPiecesThrown().get(i);
int v2 = ceremonyNotification.getPiecesLost().get(i);
int v3 = ceremonyNotification.getBonusCardsPlayed().get(i);
int v4 = ceremonyNotification.getSixes().get(i);
int v5 = ceremonyNotification.getNodesMoved().get(i);
int v6 = ceremonyNotification.getBonusNodes().get(i);
ceremonyView.addCeremonyParticipant(color, i, name);
ceremonyView.addStatisticsRow(name, v1, v2, v3, v4, v5, v6);