From aa44b846487435f6b1366d555a03ae4aa4d64d46 Mon Sep 17 00:00:00 2001 From: Daniel Grigencha Date: Wed, 11 Dec 2024 05:34:34 +0100 Subject: [PATCH 01/14] removed unused imports and reformatted the code for code style --- Projekte/mdga/client/hs_err_pid24033.log | 1887 ----------------- Projekte/mdga/client/hs_err_pid54211.log | 21 - Projekte/mdga/client/hs_err_pid60653.log | 171 -- .../src/main/java/pp/mdga/client/Asset.java | 8 +- .../pp/mdga/client/InputSynchronizer.java | 82 +- .../src/main/java/pp/mdga/client/MdgaApp.java | 68 +- .../pp/mdga/client/ModelSynchronizer.java | 18 +- .../mdga/client/NotificationSynchronizer.java | 56 +- .../src/main/java/pp/mdga/client/Util.java | 11 +- .../mdga/client/acoustic/AcousticHandler.java | 43 +- .../acoustic/SoundAssetDelayVolume.java | 3 +- .../mdga/client/animation/ActionControl.java | 8 +- .../pp/mdga/client/animation/Explosion.java | 14 +- .../pp/mdga/client/animation/FadeControl.java | 5 +- .../mdga/client/animation/JetAnimation.java | 22 +- .../client/animation/MatrixAnimation.java | 59 +- .../client/animation/MissileAnimation.java | 24 +- .../pp/mdga/client/animation/MoveControl.java | 21 +- .../mdga/client/animation/ShellAnimation.java | 26 +- .../mdga/client/animation/ShellControl.java | 7 +- .../java/pp/mdga/client/animation/Smoke.java | 14 +- .../mdga/client/animation/SymbolControl.java | 4 +- .../pp/mdga/client/animation/ZoomControl.java | 8 +- .../java/pp/mdga/client/board/AssetOnMap.java | 3 +- .../pp/mdga/client/board/BoardHandler.java | 236 +-- .../pp/mdga/client/board/CameraHandler.java | 14 +- .../java/pp/mdga/client/board/MapLoader.java | 12 +- .../pp/mdga/client/board/NodeControl.java | 23 +- .../pp/mdga/client/board/OutlineControl.java | 18 +- .../pp/mdga/client/board/PieceControl.java | 68 +- .../pp/mdga/client/board/TankTopControl.java | 6 +- .../pp/mdga/client/button/AbstractButton.java | 2 +- .../pp/mdga/client/button/ButtonLeft.java | 1 - .../pp/mdga/client/button/CeremonyButton.java | 25 +- .../pp/mdga/client/button/ClickButton.java | 16 +- .../pp/mdga/client/button/LabelButton.java | 3 +- .../pp/mdga/client/button/LobbyButton.java | 26 +- .../pp/mdga/client/button/MenuButton.java | 8 +- .../pp/mdga/client/button/SettingsButton.java | 2 - .../client/dialog/AudioSettingsDialog.java | 2 +- .../pp/mdga/client/dialog/CeremonyDialog.java | 2 +- .../java/pp/mdga/client/dialog/Dialog.java | 1 - .../pp/mdga/client/dialog/HostDialog.java | 2 +- .../mdga/client/dialog/InterruptDialog.java | 4 +- .../pp/mdga/client/dialog/JoinDialog.java | 1 - .../pp/mdga/client/dialog/NetworkDialog.java | 6 +- .../pp/mdga/client/dialog/SettingsDialog.java | 2 - .../pp/mdga/client/dialog/StartDialog.java | 416 ++-- .../client/dialog/VideoSettingsDialog.java | 13 +- .../pp/mdga/client/gui/ActionTextHandler.java | 92 +- .../java/pp/mdga/client/gui/CardControl.java | 51 +- .../java/pp/mdga/client/gui/CardLayer.java | 5 +- .../pp/mdga/client/gui/CardLayerHandler.java | 30 +- .../java/pp/mdga/client/gui/DiceControl.java | 38 +- .../java/pp/mdga/client/gui/GuiHandler.java | 34 +- .../pp/mdga/client/gui/PlayerNameHandler.java | 58 +- .../pp/mdga/client/outline/OutlineFilter.java | 98 +- .../mdga/client/outline/OutlinePreFilter.java | 80 +- .../client/outline/SelectObjectOutliner.java | 43 +- .../pp/mdga/client/server/MdgaServer.java | 5 +- .../pp/mdga/client/server/UUIDSerializer.java | 29 +- .../pp/mdga/client/view/CeremonyView.java | 8 +- .../java/pp/mdga/client/view/GameView.java | 8 +- .../java/pp/mdga/client/view/LobbyView.java | 35 +- .../java/pp/mdga/client/view/MainView.java | 14 +- .../java/pp/mdga/client/view/MdgaView.java | 12 +- .../java/pp/mdga/client/CeremonyState.java | 15 +- .../main/java/pp/mdga/client/ClientState.java | 25 +- .../java/pp/mdga/client/DialogsState.java | 42 +- .../main/java/pp/mdga/client/GameState.java | 70 +- .../java/pp/mdga/client/InterruptState.java | 7 +- .../java/pp/mdga/client/SettingsState.java | 10 +- .../client/ceremonystate/PodiumState.java | 2 +- .../client/ceremonystate/StatisticsState.java | 2 +- .../mdga/client/dialogstate/DialogStates.java | 2 +- .../mdga/client/dialogstate/LobbyState.java | 4 +- .../dialogstate/NetworkDialogState.java | 3 +- .../client/dialogstate/StartDialogState.java | 3 +- .../mdga/client/gamestate/AnimationState.java | 2 +- .../gamestate/DetermineStartPlayerState.java | 19 +- .../pp/mdga/client/gamestate/GameStates.java | 19 +- .../mdga/client/gamestate/SpectatorState.java | 6 +- .../pp/mdga/client/gamestate/TurnState.java | 61 +- .../mdga/client/gamestate/WaitingState.java | 39 +- .../determinestartplayerstate/Intro.java | 18 +- .../RollRankingDiceState.java | 12 +- .../WaitRankingState.java | 17 +- .../gamestate/turnstate/ChoosePieceState.java | 30 +- .../gamestate/turnstate/MovePieceState.java | 15 +- .../turnstate/PlayPowerCardState.java | 8 +- .../gamestate/turnstate/PowerCardState.java | 10 +- .../gamestate/turnstate/RollDiceState.java | 19 +- .../gamestate/turnstate/TurnStates.java | 2 +- .../choosepiecestate/NoPieceState.java | 12 +- .../choosepiecestate/SelectPieceState.java | 27 +- .../choosepiecestate/StartPieceState.java | 25 +- .../choosepiecestate/WaitingPieceState.java | 12 +- .../powercardstate/ChoosePowerCardState.java | 32 +- .../turnstate/powercardstate/ShieldState.java | 2 - .../turnstate/powercardstate/SwapState.java | 14 +- .../src/main/java/pp/mdga/game/Board.java | 2 +- .../src/main/java/pp/mdga/game/Color.java | 4 +- .../src/main/java/pp/mdga/game/Game.java | 4 +- .../src/main/java/pp/mdga/game/Node.java | 2 +- .../src/main/java/pp/mdga/game/Piece.java | 1 - .../src/main/java/pp/mdga/game/Player.java | 18 +- .../java/pp/mdga/game/card/ShieldCard.java | 1 + .../message/client/JoinedLobbyMessage.java | 2 +- .../mdga/message/server/CeremonyMessage.java | 1 + .../server/ChoosePieceStateMessage.java | 1 + .../pp/mdga/message/server/DieMessage.java | 2 - .../mdga/message/server/DrawCardMessage.java | 10 +- .../server/IncorrectRequestMessage.java | 2 +- .../server/LobbyPlayerLeaveMessage.java | 1 - .../pp/mdga/message/server/MoveMessage.java | 6 +- .../message/server/PossiblePieceMessage.java | 2 - .../message/server/SelectPieceMessage.java | 2 +- .../notification/AcquireCardNotification.java | 4 +- .../mdga/notification/FinishNotification.java | 4 +- .../mdga/notification/GameNotification.java | 2 +- .../mdga/notification/InfoNotification.java | 6 +- .../notification/LobbyReadyNotification.java | 2 +- .../notification/MovePieceNotification.java | 6 +- .../RankingResponceNotification.java | 3 +- .../notification/RollDiceNotification.java | 12 +- .../SelectableCardsNotification.java | 3 + .../SelectableMoveNotification.java | 4 +- .../SelectableShieldNotification.java | 4 +- .../notification/TurboActiveNotification.java | 2 +- .../java/pp/mdga/server/ServerGameLogic.java | 2 +- .../mdga/server/automaton/CeremonyState.java | 5 +- .../pp/mdga/server/automaton/GameState.java | 8 +- .../pp/mdga/server/automaton/LobbyState.java | 13 +- .../pp/mdga/server/automaton/ServerState.java | 51 +- .../game/DetermineStartPlayerState.java | 17 +- .../mdga/server/automaton/game/TurnState.java | 11 +- .../automaton/game/turn/MovePieceState.java | 9 +- .../game/turn/PlayPowerCardState.java | 1 - .../automaton/game/turn/PowerCardState.java | 15 +- .../automaton/game/turn/RollDiceState.java | 4 +- .../ChoosePieceAutomatonState.java | 18 +- .../game/turn/choosepiece/NoPieceState.java | 24 +- .../turn/choosepiece/SelectPieceState.java | 18 +- .../turn/choosepiece/StartPieceState.java | 3 +- .../turn/choosepiece/WaitingPieceState.java | 4 +- .../turn/powercard/ChoosePowerCardState.java | 6 +- .../powercard/PowerCardAutomatonState.java | 2 +- .../game/turn/powercard/ShieldCardState.java | 5 +- .../game/turn/powercard/SwapCardState.java | 9 +- .../game/turn/rolldice/FirstRollState.java | 4 +- .../game/turn/rolldice/SecondRollState.java | 1 - .../pp/mdga/visitor/ServerCardVisitor.java | 6 +- .../client/clientState/ClientStateTest.java | 75 +- .../src/test/java/pp/mdga/game/PieceTest.java | 358 ++-- .../server/serverState/ServerStateTest.java | 44 +- 155 files changed, 1662 insertions(+), 3882 deletions(-) delete mode 100644 Projekte/mdga/client/hs_err_pid24033.log delete mode 100644 Projekte/mdga/client/hs_err_pid54211.log delete mode 100644 Projekte/mdga/client/hs_err_pid60653.log diff --git a/Projekte/mdga/client/hs_err_pid24033.log b/Projekte/mdga/client/hs_err_pid24033.log deleted file mode 100644 index 48b7dcc7..00000000 --- a/Projekte/mdga/client/hs_err_pid24033.log +++ /dev/null @@ -1,1887 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x00007df871cddf68, pid=24033, tid=24139 -# -# JRE version: OpenJDK Runtime Environment (21.0.5+11) (build 21.0.5+11) -# Java VM: OpenJDK 64-Bit Server VM (21.0.5+11, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) -# Problematic frame: -# C [liblwjgl.so+0x56f68] -# -# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/koppe/Workspace/gruppe01/Projekte/mdga/client/core.24033) -# -# If you would like to submit a bug report, please visit: -# https://bugreport.java.com/bugreport/crash.jsp -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- S U M M A R Y ------------ - -Command Line: -Djava.util.logging.config.file=logging.properties -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea pp.mdga.client.MdgaApp - -Host: 12th Gen Intel(R) Core(TM) i7-12700H, 20 cores, 30G, Arch Linux -Time: Mon Dec 2 01:24:33 2024 CET elapsed time: 12.372179 seconds (0d 0h 0m 12s) - ---------------- T H R E A D --------------- - -Current thread (0x00007df7bd4b3390): JavaThread "jME3 Main" [_thread_in_native, id=24139, stack(0x00007df870b24000,0x00007df870c24000) (1024K)] - -Stack: [0x00007df870b24000,0x00007df870c24000], sp=0x00007df870be3440, free space=765k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [liblwjgl.so+0x56f68] -C [liblwjgl.so+0x581e8] -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -J 2704 org.lwjgl.system.JNI.invokeV(J)V (0 bytes) @ 0x00007df8882b66f9 [0x00007df8882b66a0+0x0000000000000059] -J 2806 c1 org.lwjgl.glfw.GLFW.glfwPollEvents()V (9 bytes) @ 0x00007df880ae7424 [0x00007df880ae73c0+0x0000000000000064] -j com.jme3.system.lwjgl.LwjglWindow.createContext(Lcom/jme3/system/AppSettings;)V+495 -j com.jme3.system.lwjgl.LwjglWindow.initInThread()Z+34 -j com.jme3.system.lwjgl.LwjglWindow.run()V+34 -j java.lang.Thread.runWith(Ljava/lang/Object;Ljava/lang/Runnable;)V+5 java.base@21.0.5 -j java.lang.Thread.run()V+19 java.base@21.0.5 -v ~StubRoutines::call_stub 0x00007df887a5fcc6 - -siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000 - -Registers: -RAX=0x00007df870c22460, RBX=0x00007df870c22590, RCX=0x0000000000000000, RDX=0x0000000000000040 -RSP=0x00007df870be3440, RBP=0x00007df870c224a0, RSI=0x0000000000000000, RDI=0x00007df871cfc5b0 -R8 =0x00007df870c224b0, R9 =0x00007df870c22590, R10=0x00007df8a13dc150, R11=0x0000000000000246 -R12=0x0000000000000000, R13=0x0000000000000000, R14=0x0000000000000000, R15=0x00007df871ce26a4 -RIP=0x00007df871cddf68, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000004 - TRAPNO=0x000000000000000e - - -Register to memory mapping: - -RAX=0x00007df870c22460 is pointing into the stack for thread: 0x00007df7bd4b3390 -RBX=0x00007df870c22590 is pointing into the stack for thread: 0x00007df7bd4b3390 -RCX=0x0 is null -RDX=0x0000000000000040 is an unknown value -RSP=0x00007df870be3440 is pointing into the stack for thread: 0x00007df7bd4b3390 -RBP=0x00007df870c224a0 is pointing into the stack for thread: 0x00007df7bd4b3390 -RSI=0x0 is null -RDI=0x00007df871cfc5b0: in /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl.so at 0x00007df871c87000 -R8 =0x00007df870c224b0 is pointing into the stack for thread: 0x00007df7bd4b3390 -R9 =0x00007df870c22590 is pointing into the stack for thread: 0x00007df7bd4b3390 -R10=0x00007df8a13dc150 points into unknown readable memory: 0x00007df8a13dc140 | 40 c1 3d a1 f8 7d 00 00 -R11=0x0000000000000246 is an unknown value -R12=0x0 is null -R13=0x0 is null -R14=0x0 is null -R15=0x00007df871ce26a4: in /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl.so at 0x00007df871c87000 - -Top of Stack: (sp=0x00007df870be3440) -0x00007df870be3440: 0000000000000000 0000000000000000 -0x00007df870be3450: 0000000000000000 0000000000000000 -0x00007df870be3460: 0000000000000000 0000000000000000 -0x00007df870be3470: 0000000000000000 0000000000000000 -0x00007df870be3480: 0000000000000000 0000000000000000 -0x00007df870be3490: 0000000000000000 0000000000000000 -0x00007df870be34a0: 0000000000000000 0000000000000000 -0x00007df870be34b0: 0000000000000000 0000000000000000 -0x00007df870be34c0: 0000000000000000 0000000000000000 -0x00007df870be34d0: 0000000000000000 0000000000000000 -0x00007df870be34e0: 0000000000000000 0000000000000000 -0x00007df870be34f0: 0000000000000000 0000000000000000 -0x00007df870be3500: 0000000000000000 0000000000000000 -0x00007df870be3510: 0000000000000000 0000000000000000 -0x00007df870be3520: 0000000000000000 0000000000000000 -0x00007df870be3530: 0000000000000000 0000000000000000 -0x00007df870be3540: 0000000000000000 0000000000000000 -0x00007df870be3550: 0000000000000000 0000000000000000 -0x00007df870be3560: 0000000000000000 0000000000000000 -0x00007df870be3570: 0000000000000000 0000000000000000 -0x00007df870be3580: 0000000000000000 0000000000000000 -0x00007df870be3590: 0000000000000000 0000000000000000 -0x00007df870be35a0: 0000000000000000 0000000000000000 -0x00007df870be35b0: 0000000000000000 0000000000000000 -0x00007df870be35c0: 0000000000000000 0000000000000000 -0x00007df870be35d0: 0000000000000000 0000000000000000 -0x00007df870be35e0: 0000000000000000 0000000000000000 -0x00007df870be35f0: 0000000000000000 0000000000000000 -0x00007df870be3600: 0000000000000000 0000000000000000 -0x00007df870be3610: 0000000000000000 0000000000000000 -0x00007df870be3620: 0000000000000000 0000000000000000 -0x00007df870be3630: 0000000000000000 0000000000000000 - -Instructions: (pc=0x00007df871cddf68) -0x00007df871cdde68: 48 8d 35 b1 14 00 00 48 8b 7d 00 48 89 ea e8 95 -0x00007df871cdde78: ed ff ff eb a6 0f 1f 00 48 83 c4 08 4c 89 ea 5d -0x00007df871cdde88: 41 5c 41 5d 41 5e e9 8d 34 00 00 0f 1f 44 00 00 -0x00007df871cdde98: 48 8d 35 71 14 00 00 eb ce 66 66 2e 0f 1f 84 00 -0x00007df871cddea8: 00 00 00 00 0f 1f 40 00 55 48 89 e5 41 57 41 56 -0x00007df871cddeb8: 41 55 41 54 53 4c 89 cb 48 83 ec 68 8b 47 04 48 -0x00007df871cddec8: 89 4d 88 8b 4f 1c 48 89 7d 90 48 89 b5 78 ff ff -0x00007df871cdded8: ff 48 89 95 70 ff ff ff 48 89 45 b8 48 8d 04 c5 -0x00007df871cddee8: 17 00 00 00 48 c1 e8 04 89 4d 84 48 c1 e0 04 4c -0x00007df871cddef8: 89 45 98 48 29 c4 4c 8d 64 24 0f 49 83 e4 f0 81 -0x00007df871cddf08: e1 00 04 00 00 4c 89 65 b0 89 4d a4 74 1c 49 8b -0x00007df871cddf18: 00 c7 45 84 07 00 00 00 48 8b 4d 88 c7 45 a4 01 -0x00007df871cddf28: 00 00 00 48 89 45 88 48 89 01 48 8b 45 90 45 31 -0x00007df871cddf38: ed c7 45 a0 00 00 00 00 48 83 7d b8 00 4c 8d 3d -0x00007df871cddf48: 58 47 00 00 4c 8b 60 08 48 8d 45 c0 48 89 45 a8 -0x00007df871cddf58: 0f 84 87 00 00 00 4d 89 e6 0f 1f 80 00 00 00 00 -0x00007df871cddf68: 4f 8b 24 ee 31 d2 48 8b 75 a8 4c 89 e7 e8 36 ee -0x00007df871cddf78: ff ff 48 85 c0 48 89 c2 74 26 31 f6 45 31 d2 45 -0x00007df871cddf88: 31 c9 31 c0 83 7c 85 c0 09 0f 87 e0 36 fd ff 8b -0x00007df871cddf98: 44 85 c0 49 63 04 87 4c 01 f8 ff e0 0f 1f 40 00 -0x00007df871cddfa8: 41 0f b7 44 24 08 ba 08 00 00 00 48 8b 4d b0 48 -0x00007df871cddfb8: 39 d0 48 0f 4c c2 48 83 eb 01 48 83 e8 01 48 09 -0x00007df871cddfc8: d8 48 83 c0 01 4a 89 04 e9 4b 8b 14 ee 48 03 02 -0x00007df871cddfd8: 48 89 c3 49 83 c5 01 4c 39 6d b8 75 83 48 8b 85 -0x00007df871cddfe8: 78 ff ff ff 48 8b 8d 70 ff ff ff 48 8b 55 b0 48 -0x00007df871cddff8: 8b 75 88 48 8b 7d 90 ff d0 8b 45 84 48 8d 65 d8 -0x00007df871cde008: 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 1f 44 00 00 -0x00007df871cde018: 41 83 c2 01 8d 46 01 48 39 c2 48 89 c6 0f 87 61 -0x00007df871cde028: ff ff ff 44 03 4d a4 41 83 f9 06 0f 8f 6f ff ff -0x00007df871cde038: ff 44 03 55 a0 41 83 fa 08 0f 8f 61 ff ff ff 8b -0x00007df871cde048: 45 c0 83 e8 03 48 83 fa 01 0f 84 81 01 00 00 48 -0x00007df871cde058: 83 fa 02 75 53 83 f8 03 0f 86 15 01 00 00 8b 45 - - -Stack slot to memory mapping: - -stack at sp + 0 slots: 0x0 is null -stack at sp + 1 slots: 0x0 is null -stack at sp + 2 slots: 0x0 is null -stack at sp + 3 slots: 0x0 is null -stack at sp + 4 slots: 0x0 is null -stack at sp + 5 slots: 0x0 is null -stack at sp + 6 slots: 0x0 is null -stack at sp + 7 slots: 0x0 is null - - -Compiled method (n/a) 12381 2704 n 0 org.lwjgl.system.JNI::invokeV (native) - total in heap [0x00007df8882b6510,0x00007df8882b6870] = 864 - relocation [0x00007df8882b6668,0x00007df8882b66a0] = 56 - main code [0x00007df8882b66a0,0x00007df8882b6863] = 451 - stub code [0x00007df8882b6863,0x00007df8882b6868] = 5 - oops [0x00007df8882b6868,0x00007df8882b6870] = 8 - -[Constant Pool (empty)] - -[MachCode] -[Entry Point] - # {method} {0x00007df8105c9e38} 'invokeV' '(J)V' in 'org/lwjgl/system/JNI' - # parm0: rsi:rsi = long - # [sp+0x50] (sp of caller) - 0x00007df8882b66a0: 448b 5608 | 49bb 0000 | 001b f87d | 0000 4d03 | d349 3bc2 | 0f84 0600 - - 0x00007df8882b66b8: ; {runtime_call ic_miss_stub} - 0x00007df8882b66b8: 0000 e9c1 | 697f ff90 -[Verified Entry Point] - 0x00007df8882b66c0: 8984 2400 | c0fe ff55 | 488b ec48 | 83ec 4090 | 4181 7f20 | 0700 0000 - - 0x00007df8882b66d8: ; {runtime_call StubRoutines (final stubs)} - 0x00007df8882b66d8: 7405 e8c1 | cd7d ff48 - - 0x00007df8882b66e0: ; {oop(a 'java/lang/Class'{0x0000000628c910e0} = 'org/lwjgl/system/JNI')} - 0x00007df8882b66e0: 8bd6 49be | e010 c928 | 0600 0000 | 4c89 7424 | 304c 8d74 | 2430 498b | f6c5 f877 - - 0x00007df8882b66fc: ; {internal_word} - 0x00007df8882b66fc: 49ba f966 | 2b88 f87d | 0000 4d89 | 97a0 0300 | 0049 89a7 | 9803 0000 - - 0x00007df8882b6714: ; {external_word} - 0x00007df8882b6714: 803d 2138 | dd18 000f | 8432 0000 - - 0x00007df8882b6720: ; {metadata({method} {0x00007df8105c9e38} 'invokeV' '(J)V' in 'org/lwjgl/system/JNI')} - 0x00007df8882b6720: 0056 5248 | be38 9e5c | 10f8 7d00 | 0049 8bff | 40f6 c40f | 0f84 1200 | 0000 4883 - - 0x00007df8882b673c: ; {runtime_call} - 0x00007df8882b673c: ec08 e8cd | 1c5d 1848 | 83c4 08e9 | 0500 0000 - - 0x00007df8882b674c: ; {runtime_call} - 0x00007df8882b674c: e8bf 1c5d | 185a 5e49 | 8dbf b803 | 0000 41c7 | 8744 0400 | 0004 0000 - - 0x00007df8882b6764: ; {runtime_call Java_org_lwjgl_system_JNI_invokeV__J} - 0x00007df8882b6764: 00e8 56d8 | 9fe9 c5f8 | 7741 c787 | 4404 0000 | 0500 0000 | f083 4424 | c000 493b | af48 0400 - 0x00007df8882b6784: 000f 870e | 0000 0041 | 83bf 4004 | 0000 000f | 841c 0000 | 00c5 f877 | 498b ff4c | 8be4 4883 - 0x00007df8882b67a4: ec00 4883 - - 0x00007df8882b67a8: ; {runtime_call} - 0x00007df8882b67a8: e4f0 e8a1 | c820 1849 | 8be4 4d33 | e441 c787 | 4404 0000 | 0800 0000 | 4183 bfc0 | 0400 0002 - 0x00007df8882b67c8: 0f84 7700 - - 0x00007df8882b67cc: ; {external_word} - 0x00007df8882b67cc: 0000 803d | 6737 dd18 | 000f 842e - - 0x00007df8882b67d8: ; {metadata({method} {0x00007df8105c9e38} 'invokeV' '(J)V' in 'org/lwjgl/system/JNI')} - 0x00007df8882b67d8: 0000 0048 | be38 9e5c | 10f8 7d00 | 0049 8bff | 40f6 c40f | 0f84 1200 | 0000 4883 - - 0x00007df8882b67f4: ; {runtime_call} - 0x00007df8882b67f4: ec08 e825 | 1c5d 1848 | 83c4 08e9 | 0500 0000 - - 0x00007df8882b6804: ; {runtime_call} - 0x00007df8882b6804: e817 1c5d | 1849 c787 | 9803 0000 | 0000 0000 | 49c7 87a0 | 0300 0000 | 0000 00c5 | f877 498b - 0x00007df8882b6824: 8f28 0400 | 00c7 8100 | 0100 0000 | 0000 00c9 | 4983 7f08 | 000f 8501 | 0000 00c3 - - 0x00007df8882b6840: ; {runtime_call StubRoutines (initial stubs)} - 0x00007df8882b6840: e9bb 937a | ffc5 f877 | 4c8b e448 | 83ec 0048 - - 0x00007df8882b6850: ; {runtime_call} - 0x00007df8882b6850: 83e4 f0e8 | f867 5d18 | 498b e44d | 33e4 e96b | ffff fff4 | f4f4 f4f4 -[/MachCode] - - -Compiled method (c1) 12386 2806 3 org.lwjgl.glfw.GLFW::glfwPollEvents (9 bytes) - total in heap [0x00007df880ae7210,0x00007df880ae7550] = 832 - relocation [0x00007df880ae7368,0x00007df880ae73a8] = 64 - main code [0x00007df880ae73c0,0x00007df880ae74a0] = 224 - stub code [0x00007df880ae74a0,0x00007df880ae74e0] = 64 - oops [0x00007df880ae74e0,0x00007df880ae74e8] = 8 - metadata [0x00007df880ae74e8,0x00007df880ae74f0] = 8 - scopes data [0x00007df880ae74f0,0x00007df880ae7508] = 24 - scopes pcs [0x00007df880ae7508,0x00007df880ae7548] = 64 - dependencies [0x00007df880ae7548,0x00007df880ae7550] = 8 - -[Constant Pool (empty)] - -[MachCode] -[Verified Entry Point] - # {method} {0x00007df81060bd10} 'glfwPollEvents' '()V' in 'org/lwjgl/glfw/GLFW' - # [sp+0x30] (sp of caller) - 0x00007df880ae73c0: 8984 2400 | c0fe ff55 | 4883 ec20 | 4181 7f20 | 0700 0000 - - 0x00007df880ae73d4: ; {runtime_call StubRoutines (final stubs)} - 0x00007df880ae73d4: 7405 e8c5 - - 0x00007df880ae73d8: ; {metadata(method data for {method} {0x00007df81060bd10} 'glfwPollEvents' '()V' in 'org/lwjgl/glfw/GLFW')} - 0x00007df880ae73d8: c0fa 0648 | be28 b0d1 | 10f8 7d00 | 008b bef4 | 0000 0083 | c702 89be | f400 0000 | 81e7 fe07 - 0x00007df880ae73f8: 0000 85ff | 0f84 3d00 - - 0x00007df880ae7400: ; {metadata(method data for {method} {0x00007df81060bd10} 'glfwPollEvents' '()V' in 'org/lwjgl/glfw/GLFW')} - 0x00007df880ae7400: 0000 48be | 28b0 d110 | f87d 0000 | 4883 8638 | 0100 0001 | 48be 40e7 | 7270 f87d - - 0x00007df880ae741c: ; {static_call} - 0x00007df880ae741c: 0000 90e8 - - 0x00007df880ae7420: ; ImmutableOopMap {} - ;*invokestatic invokeV {reexecute=0 rethrow=0 return_oop=0} - ; - org.lwjgl.glfw.GLFW::glfwPollEvents@5 (line 3438) - 0x00007df880ae7420: 9cf2 7c07 - - 0x00007df880ae7424: ; {other} - 0x00007df880ae7424: 0f1f 8400 | 1402 0000 | 4883 c420 - - 0x00007df880ae7430: ; {poll_return} - 0x00007df880ae7430: 5d49 3ba7 | 4804 0000 | 0f87 1f00 - - 0x00007df880ae743c: ; {metadata({method} {0x00007df81060bd10} 'glfwPollEvents' '()V' in 'org/lwjgl/glfw/GLFW')} - 0x00007df880ae743c: 0000 c349 | ba10 bd60 | 10f8 7d00 | 004c 8954 | 2408 48c7 | 0424 ffff - - 0x00007df880ae7454: ; {runtime_call counter_overflow Runtime1 stub} - 0x00007df880ae7454: ffff e825 - - 0x00007df880ae7458: ; ImmutableOopMap {} - ;*synchronization entry - ; - org.lwjgl.glfw.GLFW::glfwPollEvents@-1 (line 3437) - 0x00007df880ae7458: c908 07eb - - 0x00007df880ae745c: ; {internal_word} - 0x00007df880ae745c: a549 ba31 | 74ae 80f8 | 7d00 004d | 8997 6004 - - 0x00007df880ae746c: ; {runtime_call SafepointBlob} - 0x00007df880ae746c: 0000 e98d | cbfc 0649 | 8b87 f804 | 0000 49c7 | 87f8 0400 | 0000 0000 | 0049 c787 | 0005 0000 - 0x00007df880ae748c: 0000 0000 | 4883 c420 - - 0x00007df880ae7494: ; {runtime_call unwind_exception Runtime1 stub} - 0x00007df880ae7494: 5de9 6639 | 0807 f4f4 | f4f4 f4f4 -[Stub Code] - 0x00007df880ae74a0: ; {no_reloc} - 0x00007df880ae74a0: 48bb 0000 | 0000 0000 - - 0x00007df880ae74a8: ; {runtime_call nmethod} - 0x00007df880ae74a8: 0000 e9fb - - 0x00007df880ae74ac: ; {runtime_call handle_exception_from_callee Runtime1 stub} - 0x00007df880ae74ac: ffff ffe8 | 4c81 0807 - - 0x00007df880ae74b4: ; {external_word} - 0x00007df880ae74b4: 48bf b073 | e0a0 f87d | 0000 4883 - - 0x00007df880ae74c0: ; {runtime_call} - 0x00007df880ae74c0: e4f0 e809 | 5bc3 1ff4 -[Deopt Handler Code] - 0x00007df880ae74c8: ; {section_word} - 0x00007df880ae74c8: 49ba c874 | ae80 f87d | 0000 4152 - - 0x00007df880ae74d4: ; {runtime_call DeoptimizationBlob} - 0x00007df880ae74d4: e9c7 bdfc | 06f4 f4f4 | f4f4 f4f4 -[/MachCode] - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x00007df770001040, length=22, elements={ -0x00007df898141fc0, 0x00007df898143650, 0x00007df898144de0, 0x00007df898146420, -0x00007df8981479c0, 0x00007df898149580, 0x00007df89814ac40, 0x00007df898157770, -0x00007df89815a890, 0x00007df898570920, 0x00007df89801c070, 0x00007df7bc418f70, -0x00007df7bc991140, 0x00007df7bc9c0cb0, 0x00007df7bd59c980, 0x00007df7bd59d9c0, -0x00007df7bd59e5a0, 0x00007df6e03df070, 0x00007df7e02c73f0, 0x00007df6d8004e20, -0x00007df7e02ca4a0, 0x00007df7bd4b3390 -} - -Java Threads: ( => current thread ) - 0x00007df898141fc0 JavaThread "Reference Handler" daemon [_thread_blocked, id=24046, stack(0x00007df871700000,0x00007df871800000) (1024K)] - 0x00007df898143650 JavaThread "Finalizer" daemon [_thread_blocked, id=24047, stack(0x00007df8715ff000,0x00007df8716ff000) (1024K)] - 0x00007df898144de0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=24048, stack(0x00007df8714fe000,0x00007df8715fe000) (1024K)] - 0x00007df898146420 JavaThread "Service Thread" daemon [_thread_blocked, id=24049, stack(0x00007df8713fd000,0x00007df8714fd000) (1024K)] - 0x00007df8981479c0 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=24050, stack(0x00007df8712fc000,0x00007df8713fc000) (1024K)] - 0x00007df898149580 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=24051, stack(0x00007df8711fb000,0x00007df8712fb000) (1024K)] - 0x00007df89814ac40 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=24052, stack(0x00007df8710fa000,0x00007df8711fa000) (1024K)] - 0x00007df898157770 JavaThread "Notification Thread" daemon [_thread_blocked, id=24053, stack(0x00007df870f28000,0x00007df871028000) (1024K)] - 0x00007df89815a890 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=24054, stack(0x00007df870e27000,0x00007df870f27000) (1024K)] - 0x00007df898570920 JavaThread "jME3 Main" [_thread_in_native, id=24061, stack(0x00007df870a23000,0x00007df870b23000) (1024K)] - 0x00007df89801c070 JavaThread "DestroyJavaVM" [_thread_blocked, id=24035, stack(0x00007df89f900000,0x00007df89fa00000) (1024K)] - 0x00007df7bc418f70 JavaThread "LWJGL Deallocator" daemon [_thread_blocked, id=24073, stack(0x00007df8180fe000,0x00007df8181fe000) (1024K)] - 0x00007df7bc991140 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=24082, stack(0x00007df803cf3000,0x00007df803df3000) (1024K)] - 0x00007df7bc9c0cb0 JavaThread "Timer-0" daemon [_thread_blocked, id=24094, stack(0x00007df8030e7000,0x00007df8031e7000) (1024K)] - 0x00007df7bd59c980 JavaThread "AWT-XAWT" daemon [_thread_in_native, id=24112, stack(0x00007df864049000,0x00007df864149000) (1024K)] - 0x00007df7bd59d9c0 JavaThread "AWT-Shutdown" [_thread_blocked, id=24113, stack(0x00007df802500000,0x00007df802600000) (1024K)] - 0x00007df7bd59e5a0 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=24114, stack(0x00007df801c7f000,0x00007df801d7f000) (1024K)] - 0x00007df6e03df070 JavaThread "TimerQueue" daemon [_thread_blocked, id=24126, stack(0x00007df7f774b000,0x00007df7f784b000) (1024K)] - 0x00007df7e02c73f0 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=24136, stack(0x00007df800b00000,0x00007df800c00000) (1024K)] - 0x00007df6d8004e20 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=24137, stack(0x00007df870d26000,0x00007df870e26000) (1024K)] - 0x00007df7e02ca4a0 JavaThread "C2 CompilerThread2" daemon [_thread_in_native, id=24138, stack(0x00007df870c25000,0x00007df870d25000) (1024K)] -=>0x00007df7bd4b3390 JavaThread "jME3 Main" [_thread_in_native, id=24139, stack(0x00007df870b24000,0x00007df870c24000) (1024K)] -Total: 22 - -Other Threads: - 0x00007df898137e10 VMThread "VM Thread" [id=24043, stack(0x00007df871cfe000,0x00007df871dfe000) (1024K)] - 0x00007df898125ba0 WatcherThread "VM Periodic Task Thread" [id=24042, stack(0x00007df871dff000,0x00007df871eff000) (1024K)] - 0x00007df898047de0 WorkerThread "GC Thread#0" [id=24037, stack(0x00007df89c727000,0x00007df89c827000) (1024K)] - 0x00007df808009230 WorkerThread "GC Thread#1" [id=24083, stack(0x00007df803bf2000,0x00007df803cf2000) (1024K)] - 0x00007df808009db0 WorkerThread "GC Thread#2" [id=24084, stack(0x00007df803af1000,0x00007df803bf1000) (1024K)] - 0x00007df80800a930 WorkerThread "GC Thread#3" [id=24085, stack(0x00007df8039f0000,0x00007df803af0000) (1024K)] - 0x00007df80800b4b0 WorkerThread "GC Thread#4" [id=24086, stack(0x00007df8038ef000,0x00007df8039ef000) (1024K)] - 0x00007df80800c030 WorkerThread "GC Thread#5" [id=24087, stack(0x00007df8037ee000,0x00007df8038ee000) (1024K)] - 0x00007df80800cbe0 WorkerThread "GC Thread#6" [id=24088, stack(0x00007df8036ed000,0x00007df8037ed000) (1024K)] - 0x00007df80800d790 WorkerThread "GC Thread#7" [id=24089, stack(0x00007df8035ec000,0x00007df8036ec000) (1024K)] - 0x00007df80800e340 WorkerThread "GC Thread#8" [id=24090, stack(0x00007df8034eb000,0x00007df8035eb000) (1024K)] - 0x00007df80800ef10 WorkerThread "GC Thread#9" [id=24091, stack(0x00007df8033ea000,0x00007df8034ea000) (1024K)] - 0x00007df80800fb00 WorkerThread "GC Thread#10" [id=24092, stack(0x00007df8032e9000,0x00007df8033e9000) (1024K)] - 0x00007df8080106f0 WorkerThread "GC Thread#11" [id=24093, stack(0x00007df8031e8000,0x00007df8032e8000) (1024K)] - 0x00007df8083266b0 WorkerThread "GC Thread#12" [id=24142, stack(0x00007df8009ff000,0x00007df800aff000) (1024K)] - 0x00007df808326b20 WorkerThread "GC Thread#13" [id=24143, stack(0x00007df7f7b00000,0x00007df7f7c00000) (1024K)] - 0x00007df898058c00 ConcurrentGCThread "G1 Main Marker" [id=24038, stack(0x00007df89c626000,0x00007df89c726000) (1024K)] - 0x00007df898059be0 WorkerThread "G1 Conc#0" [id=24039, stack(0x00007df89c525000,0x00007df89c625000) (1024K)] - 0x00007df86c000d80 WorkerThread "G1 Conc#1" [id=24117, stack(0x00007df800224000,0x00007df800324000) (1024K)] - 0x00007df86c001940 WorkerThread "G1 Conc#2" [id=24118, stack(0x00007df800013000,0x00007df800113000) (1024K)] - 0x00007df86c002500 WorkerThread "G1 Conc#3" [id=24119, stack(0x00007df7f7f00000,0x00007df7f8000000) (1024K)] - 0x00007df89810afb0 ConcurrentGCThread "G1 Refine#0" [id=24040, stack(0x00007df878007000,0x00007df878107000) (1024K)] - 0x00007df89810bf70 ConcurrentGCThread "G1 Service" [id=24041, stack(0x00007df871f00000,0x00007df872000000) (1024K)] -Total: 23 - -Threads with active compile tasks: -C2 CompilerThread2 12393 4043 4 com.jme3.renderer.opengl.GLRenderer::updateUniform (1576 bytes) -Total: 1 - -VM state: not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -Heap address: 0x0000000610400000, size: 7932 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) mapped at: [0x00007df81b000000-0x00007df81bc97000-0x00007df81bc97000), size 13201408, SharedBaseAddress: 0x00007df81b000000, ArchiveRelocationMode: 1. -Compressed class space mapped at: 0x00007df81c000000-0x00007df85c000000, reserved size: 1073741824 -Narrow klass base: 0x00007df81b000000, Narrow klass shift: 0, Narrow klass range: 0x100000000 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 32 size 80 Howl #buckets 8 coarsen threshold 7372 Howl Bitmap #cards 1024 size 144 coarsen threshold 921 Card regions per heap region 1 cards per card region 8192 - CPUs: 20 total, 20 available - Memory: 31725M - Large Page Support: Disabled - NUMA Support: Disabled - Compressed Oops: Enabled (Zero based) - Heap Region Size: 4M - Heap Min Capacity: 8M - Heap Initial Capacity: 496M - Heap Max Capacity: 7932M - Pre-touch: Disabled - Parallel Workers: 15 - Concurrent Workers: 4 - Concurrent Refinement Workers: 15 - Periodic GC: Disabled - -Heap: - garbage-first heap total 40960K, used 11134K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 1 young (4096K), 0 survivors (0K) - Metaspace used 25132K, committed 25472K, reserved 1114112K - class space used 2436K, committed 2560K, reserved 1048576K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom -| 0|0x0000000610400000, 0x00000006106dfa88, 0x0000000610800000| 71%| O| |TAMS 0x0000000610400000| PB 0x0000000610400000| Untracked -| 1|0x0000000610800000, 0x0000000610800000, 0x0000000610c00000| 0%| F| |TAMS 0x0000000610800000| PB 0x0000000610800000| Untracked -| 2|0x0000000610c00000, 0x0000000610c00000, 0x0000000611000000| 0%| F| |TAMS 0x0000000610c00000| PB 0x0000000610c00000| Untracked -| 3|0x0000000611000000, 0x0000000611000000, 0x0000000611400000| 0%| F| |TAMS 0x0000000611000000| PB 0x0000000611000000| Untracked -| 4|0x0000000611400000, 0x0000000611400000, 0x0000000611800000| 0%| F| |TAMS 0x0000000611400000| PB 0x0000000611400000| Untracked -| 5|0x0000000611800000, 0x0000000611800000, 0x0000000611c00000| 0%| F| |TAMS 0x0000000611800000| PB 0x0000000611800000| Untracked -| 6|0x0000000611c00000, 0x0000000611c00000, 0x0000000612000000| 0%| F| |TAMS 0x0000000611c00000| PB 0x0000000611c00000| Untracked -| 7|0x0000000612000000, 0x0000000612275608, 0x0000000612400000| 61%| E| |TAMS 0x0000000612000000| PB 0x0000000612000000| Complete -| 97|0x0000000628800000, 0x0000000628c00000, 0x0000000628c00000|100%| O| |TAMS 0x0000000628800000| PB 0x0000000628800000| Untracked -| 98|0x0000000628c00000, 0x0000000629000000, 0x0000000629000000|100%| O| |TAMS 0x0000000628c00000| PB 0x0000000628c00000| Untracked - -Card table byte_map: [0x00007df89c923000,0x00007df89d8a1000] _byte_map_base: 0x00007df8998a1000 - -Marking Bits: (CMBitMap*) 0x00007df898048910 - Bits: [0x00007df878a10000, 0x00007df880600000) - -Polling page: 0x00007df8a1415000 - -Metaspace: - -Usage: - Non-class: 22.16 MB used. - Class: 2.38 MB used. - Both: 24.54 MB used. - -Virtual space: - Non-class space: 64.00 MB reserved, 22.38 MB ( 35%) committed, 1 nodes. - Class space: 1.00 GB reserved, 2.50 MB ( <1%) committed, 1 nodes. - Both: 1.06 GB reserved, 24.88 MB ( 2%) committed. - -Chunk freelists: - Non-Class: 8.84 MB - Class: 13.51 MB - Both: 22.35 MB - -MaxMetaspaceSize: unlimited -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 21.00 MB -Current GC threshold: 41.38 MB -CDS: on - - commit_granule_bytes: 65536. - - commit_granule_words: 8192. - - virtual_space_node_default_size: 8388608. - - enlarge_chunks_in_place: 1. - - use_allocation_guard: 0. - - -Internal statistics: - -num_allocs_failed_limit: 6. -num_arena_births: 356. -num_arena_deaths: 0. -num_vsnodes_births: 2. -num_vsnodes_deaths: 0. -num_space_committed: 396. -num_space_uncommitted: 0. -num_chunks_returned_to_freelist: 6. -num_chunks_taken_from_freelist: 845. -num_chunk_merges: 3. -num_chunk_splits: 538. -num_chunks_enlarged: 343. -num_inconsistent_stats: 0. - -CodeHeap 'non-profiled nmethods': size=119168Kb used=1627Kb max_used=1931Kb free=117540Kb - bounds [0x00007df8881a0000, 0x00007df888410000, 0x00007df88f600000] -CodeHeap 'profiled nmethods': size=119164Kb used=5875Kb max_used=7566Kb free=113288Kb - bounds [0x00007df880600000, 0x00007df880d70000, 0x00007df887a5f000] -CodeHeap 'non-nmethods': size=7428Kb used=3002Kb max_used=4133Kb free=4425Kb - bounds [0x00007df887a5f000, 0x00007df887e6f000, 0x00007df8881a0000] - total_blobs=4868 nmethods=3480 adapters=1292 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 12.346 Thread 0x00007df89814ac40 nmethod 4054 0x00007df88079a490 code [0x00007df88079a6a0, 0x00007df88079abe8] -Event: 12.346 Thread 0x00007df89814ac40 4056 3 com.jme3.system.lwjgl.LwjglWindow::getWindowContentScale (95 bytes) -Event: 12.347 Thread 0x00007df6d8004e20 nmethod 4034 0x00007df8881a3010 code [0x00007df8881a3180, 0x00007df8881a3248] -Event: 12.347 Thread 0x00007df6d8004e20 4008 4 java.util.TreeMap::rotateLeft (96 bytes) -Event: 12.347 Thread 0x00007df89814ac40 nmethod 4056 0x00007df88086d110 code [0x00007df88086d300, 0x00007df88086d760] -Event: 12.347 Thread 0x00007df89814ac40 4055 3 org.lwjgl.glfw.GLFW::glfwGetWindowSize (35 bytes) -Event: 12.348 Thread 0x00007df89814ac40 nmethod 4055 0x00007df8807ac110 code [0x00007df8807ac320, 0x00007df8807ac868] -Event: 12.348 Thread 0x00007df89814ac40 4057 3 org.lwjgl.glfw.GLFWCursorPosCallbackI::callback (40 bytes) -Event: 12.349 Thread 0x00007df89814ac40 nmethod 4057 0x00007df8807b5910 code [0x00007df8807b5b60, 0x00007df8807b64d8] -Event: 12.349 Thread 0x00007df89814ac40 4058 3 com.jme3.input.lwjgl.GlfwMouseInput$1::invoke (12 bytes) -Event: 12.349 Thread 0x00007df89814ac40 nmethod 4058 0x00007df8806e7710 code [0x00007df8806e78c0, 0x00007df8806e7a00] -Event: 12.349 Thread 0x00007df89814ac40 4059 3 com.jme3.input.lwjgl.GlfwMouseInput::access$000 (9 bytes) -Event: 12.349 Thread 0x00007df89814ac40 nmethod 4059 0x00007df880780210 code [0x00007df8807803c0, 0x00007df8807804e0] -Event: 12.349 Thread 0x00007df89814ac40 4060 3 com.jme3.input.lwjgl.GlfwMouseInput::onCursorPos (135 bytes) -Event: 12.350 Thread 0x00007df89814ac40 nmethod 4060 0x00007df8806dd910 code [0x00007df8806ddb60, 0x00007df8806de1f8] -Event: 12.350 Thread 0x00007df898149580 nmethod 3999 0x00007df8882de290 code [0x00007df8882de440, 0x00007df8882de7b8] -Event: 12.350 Thread 0x00007df898149580 4003 4 java.util.TreeMap::clear (21 bytes) -Event: 12.351 Thread 0x00007df898149580 nmethod 4003 0x00007df888241210 code [0x00007df888241380, 0x00007df888241468] -Event: 12.358 Thread 0x00007df6d8004e20 nmethod 4008 0x00007df88820f990 code [0x00007df88820fb40, 0x00007df888210378] -Event: 12.368 Thread 0x00007df7e02c73f0 nmethod 4050 0x00007df880a35d10 code [0x00007df880a373e0, 0x00007df880a48890] - -GC Heap History (14 events): -Event: 1.231 GC heap before -{Heap before GC invocations=0 (full 0): - garbage-first heap total 512000K, used 25649K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 6 young (24576K), 0 survivors (0K) - Metaspace used 9234K, committed 9408K, reserved 1114112K - class space used 745K, committed 832K, reserved 1048576K -} -Event: 1.239 GC heap after -{Heap after GC invocations=1 (full 0): - garbage-first heap total 512000K, used 4751K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 1 young (4096K), 1 survivors (4096K) - Metaspace used 9234K, committed 9408K, reserved 1114112K - class space used 745K, committed 832K, reserved 1048576K -} -Event: 1.531 GC heap before -{Heap before GC invocations=1 (full 0): - garbage-first heap total 512000K, used 123535K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 10 young (40960K), 1 survivors (4096K) - Metaspace used 11855K, committed 12096K, reserved 1114112K - class space used 1013K, committed 1152K, reserved 1048576K -} -Event: 1.540 GC heap after -{Heap after GC invocations=2 (full 0): - garbage-first heap total 512000K, used 91367K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 2 young (8192K), 2 survivors (8192K) - Metaspace used 11855K, committed 12096K, reserved 1114112K - class space used 1013K, committed 1152K, reserved 1048576K -} -Event: 2.303 GC heap before -{Heap before GC invocations=2 (full 0): - garbage-first heap total 512000K, used 353511K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 42 young (172032K), 2 survivors (8192K) - Metaspace used 12940K, committed 13120K, reserved 1114112K - class space used 1148K, committed 1216K, reserved 1048576K -} -Event: 2.313 GC heap after -{Heap after GC invocations=3 (full 0): - garbage-first heap total 512000K, used 6010K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 2 young (8192K), 2 survivors (8192K) - Metaspace used 12940K, committed 13120K, reserved 1114112K - class space used 1148K, committed 1216K, reserved 1048576K -} -Event: 4.765 GC heap before -{Heap before GC invocations=3 (full 0): - garbage-first heap total 512000K, used 427898K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 57 young (233472K), 2 survivors (8192K) - Metaspace used 14755K, committed 14912K, reserved 1114112K - class space used 1273K, committed 1344K, reserved 1048576K -} -Event: 4.780 GC heap after -{Heap after GC invocations=4 (full 0): - garbage-first heap total 512000K, used 9247K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 2 young (8192K), 2 survivors (8192K) - Metaspace used 14755K, committed 14912K, reserved 1114112K - class space used 1273K, committed 1344K, reserved 1048576K -} -Event: 6.802 GC heap before -{Heap before GC invocations=4 (full 0): - garbage-first heap total 512000K, used 185375K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 27 young (110592K), 2 survivors (8192K) - Metaspace used 21277K, committed 21504K, reserved 1114112K - class space used 2045K, committed 2176K, reserved 1048576K -} -Event: 6.809 GC heap after -{Heap after GC invocations=5 (full 0): - garbage-first heap total 512000K, used 11000K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 3 young (12288K), 3 survivors (12288K) - Metaspace used 21277K, committed 21504K, reserved 1114112K - class space used 2045K, committed 2176K, reserved 1048576K -} -Event: 12.210 GC heap before -{Heap before GC invocations=6 (full 0): - garbage-first heap total 57344K, used 23288K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 7 young (28672K), 3 survivors (12288K) - Metaspace used 25098K, committed 25408K, reserved 1114112K - class space used 2436K, committed 2560K, reserved 1048576K -} -Event: 12.282 GC heap after -{Heap after GC invocations=7 (full 1): - garbage-first heap total 40960K, used 11134K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 0 young (0K), 0 survivors (0K) - Metaspace used 25098K, committed 25408K, reserved 1114112K - class space used 2436K, committed 2560K, reserved 1048576K -} -Event: 12.282 GC heap before -{Heap before GC invocations=7 (full 1): - garbage-first heap total 40960K, used 11134K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 0 young (0K), 0 survivors (0K) - Metaspace used 25098K, committed 25408K, reserved 1114112K - class space used 2436K, committed 2560K, reserved 1048576K -} -Event: 12.340 GC heap after -{Heap after GC invocations=8 (full 2): - garbage-first heap total 40960K, used 11134K [0x0000000610400000, 0x0000000800000000) - region size 4096K, 0 young (0K), 0 survivors (0K) - Metaspace used 25098K, committed 25408K, reserved 1114112K - class space used 2436K, committed 2560K, reserved 1048576K -} - -Dll operation events (12 events): -Event: 0.002 Loaded shared library /usr/lib/jvm/java-21-openjdk/lib/libjava.so -Event: 0.037 Loaded shared library /usr/lib/jvm/java-21-openjdk/lib/libjsvml.so -Event: 0.052 Loaded shared library /usr/lib/jvm/java-21-openjdk/lib/libnio.so -Event: 0.054 Loaded shared library /usr/lib/jvm/java-21-openjdk/lib/libzip.so -Event: 0.102 Loaded shared library /usr/lib/jvm/java-21-openjdk/lib/libjimage.so -Event: 0.313 Loaded shared library /usr/lib/jvm/java-21-openjdk/lib/libnet.so -Event: 0.323 Loaded shared library /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl.so -Event: 0.660 Loaded shared library /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl_opengl.so -Event: 1.030 Loaded shared library /usr/lib/jvm/java-21-openjdk/lib/libawt.so -Event: 1.038 Loaded shared library /usr/lib/jvm/java-21-openjdk/lib/libawt_xawt.so -Event: 1.310 Loaded shared library /usr/lib/jvm/java-21-openjdk/lib/libprefs.so -Event: 6.523 Loaded shared library /usr/lib/jvm/java-21-openjdk/lib/libfontmanager.so - -Deoptimization events (20 events): -Event: 12.141 Thread 0x00007df7bd59e5a0 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007df8882de63c relative=0x00000000000001fc -Event: 12.141 Thread 0x00007df7bd59e5a0 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007df8882de63c method=java.lang.Integer.getChars(II[B)I @ 4 c2 -Event: 12.141 Thread 0x00007df7bd59e5a0 DEOPT PACKING pc=0x00007df8882de63c sp=0x00007df801d7c880 -Event: 12.141 Thread 0x00007df7bd59e5a0 DEOPT UNPACKING pc=0x00007df887ab2f99 sp=0x00007df801d7c830 mode 2 -Event: 12.156 Thread 0x00007df7bd59e5a0 Uncommon trap: trap_request=0xffffffde fr.pc=0x00007df88827155c relative=0x000000000000011c -Event: 12.156 Thread 0x00007df7bd59e5a0 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00007df88827155c method=java.nio.ByteBuffer.get([B)Ljava/nio/ByteBuffer; @ 5 c2 -Event: 12.156 Thread 0x00007df7bd59e5a0 DEOPT PACKING pc=0x00007df88827155c sp=0x00007df801d7ae40 -Event: 12.156 Thread 0x00007df7bd59e5a0 DEOPT UNPACKING pc=0x00007df887ab2f99 sp=0x00007df801d7adf8 mode 2 -Event: 12.156 Thread 0x00007df7bd59e5a0 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007df8881ee0d8 relative=0x00000000000000b8 -Event: 12.156 Thread 0x00007df7bd59e5a0 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007df8881ee0d8 method=java.nio.Buffer.position(I)Ljava/nio/Buffer; @ 37 c2 -Event: 12.156 Thread 0x00007df7bd59e5a0 DEOPT PACKING pc=0x00007df8881ee0d8 sp=0x00007df801d7abe0 -Event: 12.156 Thread 0x00007df7bd59e5a0 DEOPT UNPACKING pc=0x00007df887ab2f99 sp=0x00007df801d7ab88 mode 2 -Event: 12.157 Thread 0x00007df7bd59e5a0 Uncommon trap: trap_request=0xffffff45 fr.pc=0x00007df88824ff60 relative=0x00000000000000c0 -Event: 12.157 Thread 0x00007df7bd59e5a0 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00007df88824ff60 method=java.nio.Buffer.limit(I)Ljava/nio/Buffer; @ 42 c2 -Event: 12.157 Thread 0x00007df7bd59e5a0 DEOPT PACKING pc=0x00007df88824ff60 sp=0x00007df801d7ad90 -Event: 12.157 Thread 0x00007df7bd59e5a0 DEOPT UNPACKING pc=0x00007df887ab2f99 sp=0x00007df801d7ad38 mode 2 -Event: 12.157 Thread 0x00007df7bd59e5a0 Uncommon trap: trap_request=0xffffffde fr.pc=0x00007df88827155c relative=0x000000000000011c -Event: 12.157 Thread 0x00007df7bd59e5a0 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00007df88827155c method=java.nio.ByteBuffer.get([B)Ljava/nio/ByteBuffer; @ 5 c2 -Event: 12.157 Thread 0x00007df7bd59e5a0 DEOPT PACKING pc=0x00007df88827155c sp=0x00007df801d7af50 -Event: 12.157 Thread 0x00007df7bd59e5a0 DEOPT UNPACKING pc=0x00007df887ab2f99 sp=0x00007df801d7af08 mode 2 - -Classes loaded (20 events): -Event: 12.199 Loading class com/sun/org/apache/xml/internal/serializer/WriterToUTF8Buffered -Event: 12.199 Loading class com/sun/org/apache/xml/internal/serializer/WriterChain -Event: 12.199 Loading class com/sun/org/apache/xml/internal/serializer/WriterChain done -Event: 12.199 Loading class com/sun/org/apache/xml/internal/serializer/WriterToUTF8Buffered done -Event: 12.199 Loading class com/sun/org/apache/xml/internal/serializer/WriterToASCI -Event: 12.199 Loading class com/sun/org/apache/xml/internal/serializer/WriterToASCI done -Event: 12.199 Loading class java/io/FileOutputStream$1 -Event: 12.199 Loading class java/io/FileOutputStream$1 done -Event: 12.200 Loading class java/util/prefs/FileSystemPreferences$11 -Event: 12.200 Loading class java/util/prefs/FileSystemPreferences$11 done -Event: 12.200 Loading class java/awt/Window$1DisposeAction -Event: 12.200 Loading class java/awt/Window$1DisposeAction done -Event: 12.200 Loading class java/awt/KeyboardFocusManager$2 -Event: 12.200 Loading class java/awt/KeyboardFocusManager$2 done -Event: 12.200 Loading class sun/awt/SunToolkit$1 -Event: 12.200 Loading class sun/awt/SunToolkit$1 done -Event: 12.200 Loading class sun/awt/X11/XUnmapEvent -Event: 12.200 Loading class sun/awt/X11/XUnmapEvent done -Event: 12.203 Loading class java/awt/Component$FlipBufferStrategy -Event: 12.204 Loading class java/awt/Component$FlipBufferStrategy done - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 2.209 Thread 0x00007df898570920 Exception (0x000000062516bfb0) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 2.246 Thread 0x00007df898570920 Exception (0x0000000625312ee0) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 2.248 Thread 0x00007df898570920 Exception (0x0000000625323438) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 2.277 Thread 0x00007df898570920 Exception (0x0000000624c37798) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 2.278 Thread 0x00007df898570920 Exception (0x0000000624c3b988) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 2.280 Thread 0x00007df898570920 Exception (0x0000000624c4dde8) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 2.281 Thread 0x00007df898570920 Exception (0x0000000624c58828) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 3.651 Thread 0x00007df898570920 Implicit null exception at 0x00007df888280f61 to 0x00007df888281908 -Event: 5.111 Thread 0x00007df898570920 Implicit null exception at 0x00007df8882f00d7 to 0x00007df8882f30dc -Event: 5.112 Thread 0x00007df898570920 Implicit null exception at 0x00007df8882f6bb6 to 0x00007df8882f8f80 -Event: 6.582 Thread 0x00007df7bd59e5a0 Exception (0x0000000629bd3bb8) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 6.585 Thread 0x00007df7bd59e5a0 Exception (0x0000000629400588) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 6.631 Thread 0x00007df7bd59e5a0 Exception (0x00000006294d2f70) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/classfile/systemDictionary.cpp, line 312] -Event: 6.632 Thread 0x00007df7bd59e5a0 Exception (0x00000006294d6f50) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/classfile/systemDictionary.cpp, line 312] -Event: 6.640 Thread 0x00007df7bd59e5a0 Exception (0x00000006294f36f8) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 6.642 Thread 0x00007df7bd59e5a0 Exception (0x00000006294fabb8) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 6.697 Thread 0x00007df6e031da90 Exception (0x000000062959ff40) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 12.156 Thread 0x00007df7bd59e5a0 Exception (0x00000006121d98f8) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/classfile/systemDictionary.cpp, line 312] -Event: 12.197 Thread 0x00007df7bd59e5a0 Exception (0x0000000612342b30) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/interpreter/linkResolver.cpp, line 772] -Event: 12.361 Thread 0x00007df7bc945ba0 Exception (0x000000061220ce08) -thrown [/usr/src/debug/java21-openjdk/jdk21u-jdk-21.0.5-11/src/hotspot/share/prims/jvm.cpp, line 3074] - -ZGC Phase Switch (0 events): -No events - -VM Operations (20 events): -Event: 6.898 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 6.898 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 6.899 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 6.899 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 6.900 Executing VM operation: HandshakeAllThreads (Deoptimize) -Event: 6.900 Executing VM operation: HandshakeAllThreads (Deoptimize) done -Event: 7.900 Executing VM operation: Cleanup -Event: 7.901 Executing VM operation: Cleanup done -Event: 8.901 Executing VM operation: Cleanup -Event: 8.901 Executing VM operation: Cleanup done -Event: 9.901 Executing VM operation: Cleanup -Event: 9.901 Executing VM operation: Cleanup done -Event: 10.901 Executing VM operation: Cleanup -Event: 10.901 Executing VM operation: Cleanup done -Event: 11.901 Executing VM operation: Cleanup -Event: 11.901 Executing VM operation: Cleanup done -Event: 12.209 Executing VM operation: G1CollectFull (System.gc()) -Event: 12.282 Executing VM operation: G1CollectFull (System.gc()) done -Event: 12.282 Executing VM operation: G1CollectFull (System.gc()) -Event: 12.340 Executing VM operation: G1CollectFull (System.gc()) done - -Memory protections (20 events): -Event: 2.735 Protecting memory [0x00007df802500000,0x00007df802504000] with protection modes 0 -Event: 3.243 Protecting memory [0x00007df864049000,0x00007df86404d000] with protection modes 0 -Event: 3.262 Protecting memory [0x00007df802500000,0x00007df802504000] with protection modes 0 -Event: 4.083 Protecting memory [0x00007df802500000,0x00007df802504000] with protection modes 0 -Event: 4.566 Protecting memory [0x00007df801c7f000,0x00007df801c83000] with protection modes 0 -Event: 4.566 Protecting memory [0x00007df800b00000,0x00007df800b04000] with protection modes 0 -Event: 4.586 Protecting memory [0x00007df8009ff000,0x00007df800a03000] with protection modes 0 -Event: 6.145 Protecting memory [0x00007df802500000,0x00007df802504000] with protection modes 0 -Event: 6.555 Protecting memory [0x00007df864049000,0x00007df86404d000] with protection modes 0 -Event: 6.557 Protecting memory [0x00007df802500000,0x00007df802504000] with protection modes 0 -Event: 6.557 Protecting memory [0x00007df801c7f000,0x00007df801c83000] with protection modes 0 -Event: 6.690 Protecting memory [0x00007df800b00000,0x00007df800b04000] with protection modes 0 -Event: 6.763 Protecting memory [0x00007df8009ff000,0x00007df800a03000] with protection modes 0 -Event: 6.834 Protecting memory [0x00007df7f7b00000,0x00007df7f7b04000] with protection modes 0 -Event: 6.894 Protecting memory [0x00007df7f794c000,0x00007df7f7950000] with protection modes 0 -Event: 6.972 Protecting memory [0x00007df7f774b000,0x00007df7f774f000] with protection modes 0 -Event: 12.162 Protecting memory [0x00007df800b00000,0x00007df800b04000] with protection modes 0 -Event: 12.179 Protecting memory [0x00007df870d26000,0x00007df870d2a000] with protection modes 0 -Event: 12.187 Protecting memory [0x00007df870c25000,0x00007df870c29000] with protection modes 0 -Event: 12.200 Protecting memory [0x00007df870b24000,0x00007df870b28000] with protection modes 0 - -Nmethod flushes (20 events): -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880bf8210 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880bf9210 -Event: 12.312 Thread 0x00007df898137e10 flushing osr nmethod 0x00007df880c05b90 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c3c610 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c3d190 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c3db90 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c57c90 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c58e10 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c5ba90 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c5cd90 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c5d210 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c77790 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c7ff90 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880c82810 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880cdf510 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880d37e10 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880d38210 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880d3cb10 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880d3da10 -Event: 12.312 Thread 0x00007df898137e10 flushing nmethod 0x00007df880d3e490 - -Events (20 events): -Event: 6.555 Thread 0x00007df898570920 Thread added: 0x00007df7bd59c980 -Event: 6.557 Thread 0x00007df898570920 Thread added: 0x00007df7bd59d9c0 -Event: 6.557 Thread 0x00007df898570920 Thread added: 0x00007df7bd59e5a0 -Event: 6.690 Thread 0x00007df7bd59e5a0 Thread added: 0x00007df6e031da90 -Event: 6.763 Thread 0x00007df7e003c760 Thread added: 0x00007df7cc2aec80 -Event: 6.834 Thread 0x00007df89814ac40 Thread added: 0x00007df7e012faf0 -Event: 6.894 Thread 0x00007df7e003c760 Thread added: 0x00007df7cc1ce170 -Event: 6.972 Thread 0x00007df7bd59e5a0 Thread added: 0x00007df6e03df070 -Event: 7.345 Thread 0x00007df7cc1ce170 Thread exited: 0x00007df7cc1ce170 -Event: 7.345 Thread 0x00007df7e012faf0 Thread exited: 0x00007df7e012faf0 -Event: 7.355 Thread 0x00007df7cc2aec80 Thread exited: 0x00007df7cc2aec80 -Event: 8.512 Thread 0x00007df7e01d5220 Thread exited: 0x00007df7e01d5220 -Event: 8.512 Thread 0x00007df7e01d4ae0 Thread exited: 0x00007df7e01d4ae0 -Event: 9.851 Thread 0x00007df7e003c760 Thread exited: 0x00007df7e003c760 -Event: 11.739 Thread 0x00007df6e031da90 Thread exited: 0x00007df6e031da90 -Event: 12.162 Thread 0x00007df89814ac40 Thread added: 0x00007df7e02c73f0 -Event: 12.179 Thread 0x00007df7e02c73f0 Thread added: 0x00007df6d8004e20 -Event: 12.187 Thread 0x00007df89814ac40 Thread added: 0x00007df7e02ca4a0 -Event: 12.200 Thread 0x00007df898570920 Thread added: 0x00007df7bd4b3390 -Event: 12.361 Thread 0x00007df7bc945ba0 Thread exited: 0x00007df7bc945ba0 - - -Dynamic libraries: -610400000-612400000 rw-p 00000000 00:00 0 -612400000-628800000 ---p 00000000 00:00 0 -628800000-629000000 rw-p 00000000 00:00 0 -629000000-800000000 ---p 00000000 00:00 0 -6275961b8000-6275961b9000 r--p 00000000 103:02 32125531 /usr/lib/jvm/java-21-openjdk/bin/java -6275961b9000-6275961ba000 r-xp 00001000 103:02 32125531 /usr/lib/jvm/java-21-openjdk/bin/java -6275961ba000-6275961bb000 r--p 00002000 103:02 32125531 /usr/lib/jvm/java-21-openjdk/bin/java -6275961bb000-6275961bc000 r--p 00002000 103:02 32125531 /usr/lib/jvm/java-21-openjdk/bin/java -6275961bc000-6275961bd000 rw-p 00003000 103:02 32125531 /usr/lib/jvm/java-21-openjdk/bin/java -6275c6434000-6275c6462000 rw-p 00000000 00:00 0 [heap] -7df6a0000000-7df6a0021000 rw-p 00000000 00:00 0 -7df6a0021000-7df6a4000000 ---p 00000000 00:00 0 -7df6a8000000-7df6a8021000 rw-p 00000000 00:00 0 -7df6a8021000-7df6ac000000 ---p 00000000 00:00 0 -7df6b0000000-7df6b02c3000 rw-p 00000000 00:00 0 -7df6b02c3000-7df6b4000000 ---p 00000000 00:00 0 -7df6b4000000-7df6b4159000 rw-p 00000000 00:00 0 -7df6b4159000-7df6b8000000 ---p 00000000 00:00 0 -7df6bc000000-7df6bc021000 rw-p 00000000 00:00 0 -7df6bc021000-7df6c0000000 ---p 00000000 00:00 0 -7df6c0000000-7df6c0021000 rw-p 00000000 00:00 0 -7df6c0021000-7df6c4000000 ---p 00000000 00:00 0 -7df6c8000000-7df6c8021000 rw-p 00000000 00:00 0 -7df6c8021000-7df6cc000000 ---p 00000000 00:00 0 -7df6d4000000-7df6d4561000 rw-p 00000000 00:00 0 -7df6d4561000-7df6d8000000 ---p 00000000 00:00 0 -7df6d8000000-7df6d8126000 rw-p 00000000 00:00 0 -7df6d8126000-7df6dc000000 ---p 00000000 00:00 0 -7df6e0000000-7df6e04f0000 rw-p 00000000 00:00 0 -7df6e04f0000-7df6e4000000 ---p 00000000 00:00 0 -7df6eae81000-7df6efe81000 rw-s 116881000 00:10 2097 anon_inode:i915.gem -7df6f0000000-7df6fc000000 rw-p 00000000 00:00 0 -7df6fc000000-7df6fc589000 rw-p 00000000 00:00 0 -7df6fc589000-7df700000000 ---p 00000000 00:00 0 -7df703000000-7df71c000000 rw-p 00000000 00:00 0 -7df71c000000-7df71c021000 rw-p 00000000 00:00 0 -7df71c021000-7df720000000 ---p 00000000 00:00 0 -7df720000000-7df720021000 rw-p 00000000 00:00 0 -7df720021000-7df724000000 ---p 00000000 00:00 0 -7df728000000-7df728021000 rw-p 00000000 00:00 0 -7df728021000-7df72c000000 ---p 00000000 00:00 0 -7df72c000000-7df72c021000 rw-p 00000000 00:00 0 -7df72c021000-7df730000000 ---p 00000000 00:00 0 -7df734000000-7df734021000 rw-p 00000000 00:00 0 -7df734021000-7df738000000 ---p 00000000 00:00 0 -7df738000000-7df738021000 rw-p 00000000 00:00 0 -7df738021000-7df73c000000 ---p 00000000 00:00 0 -7df740000000-7df740021000 rw-p 00000000 00:00 0 -7df740021000-7df744000000 ---p 00000000 00:00 0 -7df744000000-7df744021000 rw-p 00000000 00:00 0 -7df744021000-7df748000000 ---p 00000000 00:00 0 -7df74c000000-7df74c021000 rw-p 00000000 00:00 0 -7df74c021000-7df750000000 ---p 00000000 00:00 0 -7df750000000-7df750021000 rw-p 00000000 00:00 0 -7df750021000-7df754000000 ---p 00000000 00:00 0 -7df758000000-7df758021000 rw-p 00000000 00:00 0 -7df758021000-7df75c000000 ---p 00000000 00:00 0 -7df75c000000-7df75c021000 rw-p 00000000 00:00 0 -7df75c021000-7df760000000 ---p 00000000 00:00 0 -7df764000000-7df764021000 rw-p 00000000 00:00 0 -7df764021000-7df768000000 ---p 00000000 00:00 0 -7df768000000-7df768021000 rw-p 00000000 00:00 0 -7df768021000-7df76c000000 ---p 00000000 00:00 0 -7df770000000-7df770021000 rw-p 00000000 00:00 0 -7df770021000-7df774000000 ---p 00000000 00:00 0 -7df774000000-7df7740b8000 rw-p 00000000 00:00 0 -7df7740b8000-7df778000000 ---p 00000000 00:00 0 -7df77c000000-7df77c021000 rw-p 00000000 00:00 0 -7df77c021000-7df780000000 ---p 00000000 00:00 0 -7df780000000-7df780021000 rw-p 00000000 00:00 0 -7df780021000-7df784000000 ---p 00000000 00:00 0 -7df788000000-7df788021000 rw-p 00000000 00:00 0 -7df788021000-7df78c000000 ---p 00000000 00:00 0 -7df78c000000-7df78c021000 rw-p 00000000 00:00 0 -7df78c021000-7df790000000 ---p 00000000 00:00 0 -7df794000000-7df794595000 rw-p 00000000 00:00 0 -7df794595000-7df798000000 ---p 00000000 00:00 0 -7df798000000-7df798021000 rw-p 00000000 00:00 0 -7df798021000-7df79c000000 ---p 00000000 00:00 0 -7df7a0000000-7df7a0021000 rw-p 00000000 00:00 0 -7df7a0021000-7df7a4000000 ---p 00000000 00:00 0 -7df7a4000000-7df7a4021000 rw-p 00000000 00:00 0 -7df7a4021000-7df7a8000000 ---p 00000000 00:00 0 -7df7ac000000-7df7ac021000 rw-p 00000000 00:00 0 -7df7ac021000-7df7b0000000 ---p 00000000 00:00 0 -7df7b3e00000-7df7b42ab000 r--p 00000000 103:02 30967767 /usr/lib/libLLVM.so.18.1 -7df7b42ab000-7df7b8e9d000 r-xp 004ab000 103:02 30967767 /usr/lib/libLLVM.so.18.1 -7df7b8e9d000-7df7bbbf6000 r--p 0509d000 103:02 30967767 /usr/lib/libLLVM.so.18.1 -7df7bbbf6000-7df7bbdd1000 r--p 07df5000 103:02 30967767 /usr/lib/libLLVM.so.18.1 -7df7bbdd1000-7df7bbe1b000 rw-p 07fd0000 103:02 30967767 /usr/lib/libLLVM.so.18.1 -7df7bbe1b000-7df7bbeb7000 rw-p 00000000 00:00 0 -7df7bc000000-7df7bd5a2000 rw-p 00000000 00:00 0 -7df7bd5a2000-7df7c0000000 ---p 00000000 00:00 0 -7df7c0000000-7df7c050a000 rw-p 00000000 00:00 0 -7df7c050a000-7df7c4000000 ---p 00000000 00:00 0 -7df7c8000000-7df7c8331000 rw-p 00000000 00:00 0 -7df7c8331000-7df7cc000000 ---p 00000000 00:00 0 -7df7cc000000-7df7cc3e9000 rw-p 00000000 00:00 0 -7df7cc3e9000-7df7d0000000 ---p 00000000 00:00 0 -7df7d4000000-7df7d4021000 rw-p 00000000 00:00 0 -7df7d4021000-7df7d8000000 ---p 00000000 00:00 0 -7df7d8000000-7df7d8021000 rw-p 00000000 00:00 0 -7df7d8021000-7df7dc000000 ---p 00000000 00:00 0 -7df7e0000000-7df7e03c0000 rw-p 00000000 00:00 0 -7df7e03c0000-7df7e4000000 ---p 00000000 00:00 0 -7df7e4000000-7df7e45e6000 rw-p 00000000 00:00 0 -7df7e45e6000-7df7e8000000 ---p 00000000 00:00 0 -7df7ec000000-7df7ec021000 rw-p 00000000 00:00 0 -7df7ec021000-7df7f0000000 ---p 00000000 00:00 0 -7df7f0000000-7df7f0021000 rw-p 00000000 00:00 0 -7df7f0021000-7df7f4000000 ---p 00000000 00:00 0 -7df7f6708000-7df7f6728000 rw-s 10797f000 00:10 2097 anon_inode:i915.gem -7df7f6728000-7df7f6748000 rw-s 10795f000 00:10 2097 anon_inode:i915.gem -7df7f6748000-7df7f6749000 ---p 00000000 00:00 0 -7df7f6749000-7df7f6f49000 rw-p 00000000 00:00 0 -7df7f6f49000-7df7f6f4a000 ---p 00000000 00:00 0 -7df7f6f4a000-7df7f774a000 rw-p 00000000 00:00 0 -7df7f774a000-7df7f774b000 ---p 00000000 00:00 0 -7df7f774b000-7df7f774f000 ---p 00000000 00:00 0 -7df7f774f000-7df7f784b000 rw-p 00000000 00:00 0 -7df7f784b000-7df7f794b000 rw-s 00000000 00:01 426011 /SYSV00000000 (deleted) -7df7f7a4c000-7df7f7a4f000 r--p 00000000 103:02 30949468 /usr/lib/libnss_myhostname.so.2 -7df7f7a4f000-7df7f7a64000 r-xp 00003000 103:02 30949468 /usr/lib/libnss_myhostname.so.2 -7df7f7a64000-7df7f7a71000 r--p 00018000 103:02 30949468 /usr/lib/libnss_myhostname.so.2 -7df7f7a71000-7df7f7a76000 r--p 00024000 103:02 30949468 /usr/lib/libnss_myhostname.so.2 -7df7f7a76000-7df7f7a77000 rw-p 00029000 103:02 30949468 /usr/lib/libnss_myhostname.so.2 -7df7f7a77000-7df7f7a7a000 r--p 00000000 103:02 30949471 /usr/lib/libnss_resolve.so.2 -7df7f7a7a000-7df7f7a9a000 r-xp 00003000 103:02 30949471 /usr/lib/libnss_resolve.so.2 -7df7f7a9a000-7df7f7aa3000 r--p 00023000 103:02 30949471 /usr/lib/libnss_resolve.so.2 -7df7f7aa3000-7df7f7aa4000 r--p 0002c000 103:02 30949471 /usr/lib/libnss_resolve.so.2 -7df7f7aa4000-7df7f7aa5000 rw-p 0002d000 103:02 30949471 /usr/lib/libnss_resolve.so.2 -7df7f7aa5000-7df7f7aa9000 r--p 00000000 103:02 30949469 /usr/lib/libnss_mymachines.so.2 -7df7f7aa9000-7df7f7ae7000 r-xp 00004000 103:02 30949469 /usr/lib/libnss_mymachines.so.2 -7df7f7ae7000-7df7f7afa000 r--p 00042000 103:02 30949469 /usr/lib/libnss_mymachines.so.2 -7df7f7afa000-7df7f7afd000 r--p 00055000 103:02 30949469 /usr/lib/libnss_mymachines.so.2 -7df7f7afd000-7df7f7afe000 rw-p 00058000 103:02 30949469 /usr/lib/libnss_mymachines.so.2 -7df7f7afe000-7df7f7aff000 rw-p 00000000 00:00 0 -7df7f7aff000-7df7f7b00000 ---p 00000000 00:00 0 -7df7f7b00000-7df7f7b04000 ---p 00000000 00:00 0 -7df7f7b04000-7df7f7c00000 rw-p 00000000 00:00 0 -7df7f7c00000-7df7f7ee8000 r--s 00000000 103:02 46006718 /var/cache/fontconfig/f6b893a7224233d96cb72fd88691c0b4-le64.cache-9 -7df7f7eff000-7df7f7f00000 ---p 00000000 00:00 0 -7df7f7f00000-7df7f8000000 rw-p 00000000 00:00 0 -7df7f8000000-7df7f8021000 rw-p 00000000 00:00 0 -7df7f8021000-7df7fc000000 ---p 00000000 00:00 0 -7df7fc000000-7df7fc021000 rw-p 00000000 00:00 0 -7df7fc021000-7df800000000 ---p 00000000 00:00 0 -7df800012000-7df800013000 ---p 00000000 00:00 0 -7df800013000-7df800113000 rw-p 00000000 00:00 0 -7df800113000-7df800217000 r--s 00000000 103:02 22050405 /home/koppe/.cache/fontconfig/923e285e415b1073c8df160bee08820f-le64.cache-9 -7df800223000-7df800224000 ---p 00000000 00:00 0 -7df800224000-7df800324000 rw-p 00000000 00:00 0 -7df800324000-7df8003b3000 r--s 00000000 103:02 46006783 /var/cache/fontconfig/f349e9996a5320f6dd491cedd2b1f964-le64.cache-9 -7df8003c3000-7df8003e3000 rw-s 10bfb1000 00:10 2097 anon_inode:i915.gem -7df8003e3000-7df800403000 rw-s 10bf91000 00:10 2097 anon_inode:i915.gem -7df800403000-7df800404000 r--p 00000000 103:02 30952600 /usr/lib/libbrotlicommon.so.1.1.0 -7df800404000-7df800405000 r-xp 00001000 103:02 30952600 /usr/lib/libbrotlicommon.so.1.1.0 -7df800405000-7df800424000 r--p 00002000 103:02 30952600 /usr/lib/libbrotlicommon.so.1.1.0 -7df800424000-7df800425000 r--p 00021000 103:02 30952600 /usr/lib/libbrotlicommon.so.1.1.0 -7df800425000-7df800426000 rw-p 00022000 103:02 30952600 /usr/lib/libbrotlicommon.so.1.1.0 -7df800426000-7df800428000 r--p 00000000 103:02 30949081 /usr/lib/libpcre2-8.so.0.13.0 -7df800428000-7df80049a000 r-xp 00002000 103:02 30949081 /usr/lib/libpcre2-8.so.0.13.0 -7df80049a000-7df8004c3000 r--p 00074000 103:02 30949081 /usr/lib/libpcre2-8.so.0.13.0 -7df8004c3000-7df8004c4000 r--p 0009c000 103:02 30949081 /usr/lib/libpcre2-8.so.0.13.0 -7df8004c4000-7df8004c5000 rw-p 0009d000 103:02 30949081 /usr/lib/libpcre2-8.so.0.13.0 -7df8004c5000-7df8004e3000 r--p 00000000 103:02 30955151 /usr/lib/libglib-2.0.so.0.8200.2 -7df8004e3000-7df800589000 r-xp 0001e000 103:02 30955151 /usr/lib/libglib-2.0.so.0.8200.2 -7df800589000-7df800612000 r--p 000c4000 103:02 30955151 /usr/lib/libglib-2.0.so.0.8200.2 -7df800612000-7df800613000 r--p 0014d000 103:02 30955151 /usr/lib/libglib-2.0.so.0.8200.2 -7df800613000-7df800614000 rw-p 0014e000 103:02 30955151 /usr/lib/libglib-2.0.so.0.8200.2 -7df800614000-7df800615000 rw-p 00000000 00:00 0 -7df800615000-7df80061b000 r--p 00000000 103:02 30971587 /usr/lib/libfreetype.so.6.20.2 -7df80061b000-7df8006af000 r-xp 00006000 103:02 30971587 /usr/lib/libfreetype.so.6.20.2 -7df8006af000-7df8006d6000 r--p 0009a000 103:02 30971587 /usr/lib/libfreetype.so.6.20.2 -7df8006d6000-7df8006de000 r--p 000c0000 103:02 30971587 /usr/lib/libfreetype.so.6.20.2 -7df8006de000-7df8006df000 rw-p 000c8000 103:02 30971587 /usr/lib/libfreetype.so.6.20.2 -7df8006df000-7df8006eb000 r--p 00000000 103:02 30949429 /usr/lib/libharfbuzz.so.0.61010.0 -7df8006eb000-7df8007c8000 r-xp 0000c000 103:02 30949429 /usr/lib/libharfbuzz.so.0.61010.0 -7df8007c8000-7df8007fb000 r--p 000e9000 103:02 30949429 /usr/lib/libharfbuzz.so.0.61010.0 -7df8007fb000-7df8007fd000 r--p 0011b000 103:02 30949429 /usr/lib/libharfbuzz.so.0.61010.0 -7df8007fd000-7df8007fe000 rw-p 0011d000 103:02 30949429 /usr/lib/libharfbuzz.so.0.61010.0 -7df8007fe000-7df8009fe000 rw-s 10ce31000 00:10 2097 anon_inode:i915.gem -7df8009fe000-7df8009ff000 ---p 00000000 00:00 0 -7df8009ff000-7df800a03000 ---p 00000000 00:00 0 -7df800a03000-7df800aff000 rw-p 00000000 00:00 0 -7df800aff000-7df800b00000 ---p 00000000 00:00 0 -7df800b00000-7df800b04000 ---p 00000000 00:00 0 -7df800b04000-7df800c00000 rw-p 00000000 00:00 0 -7df800c00000-7df801c00000 rw-p 00000000 00:00 0 -7df801c00000-7df801c06000 r--p 00000000 103:02 30971560 /usr/lib/libpng16.so.16.44.0 -7df801c06000-7df801c30000 r-xp 00006000 103:02 30971560 /usr/lib/libpng16.so.16.44.0 -7df801c30000-7df801c39000 r--p 00030000 103:02 30971560 /usr/lib/libpng16.so.16.44.0 -7df801c39000-7df801c3a000 r--p 00039000 103:02 30971560 /usr/lib/libpng16.so.16.44.0 -7df801c3a000-7df801c3b000 rw-p 0003a000 103:02 30971560 /usr/lib/libpng16.so.16.44.0 -7df801c49000-7df801c5d000 r--s 00000000 103:02 22045742 /home/koppe/.cache/fontconfig/614d1caaa4d7914789410f6367de37ca-le64.cache-9 -7df801c71000-7df801c7e000 r--s 00000000 103:02 22051925 /home/koppe/.cache/fontconfig/210c0516121708a580e22e6b1f9a103a-le64.cache-9 -7df801c7e000-7df801c7f000 ---p 00000000 00:00 0 -7df801c7f000-7df801c83000 ---p 00000000 00:00 0 -7df801c83000-7df801d7f000 rw-p 00000000 00:00 0 -7df801d7f000-7df801dff000 rw-s 10549f000 00:10 2097 anon_inode:i915.gem -7df801dff000-7df8024ff000 rw-p 00000000 00:00 0 -7df8024ff000-7df802500000 ---p 00000000 00:00 0 -7df802500000-7df802504000 ---p 00000000 00:00 0 -7df802504000-7df802600000 rw-p 00000000 00:00 0 -7df802600000-7df803000000 rw-p 00000000 00:00 0 -7df803006000-7df803016000 rw-s 108595000 00:10 2097 anon_inode:i915.gem -7df803016000-7df803026000 rw-s 10dc41000 00:10 2097 anon_inode:i915.gem -7df803026000-7df803066000 rw-s 10cb51000 00:10 2097 anon_inode:i915.gem -7df803066000-7df8030a6000 rw-s 10cb11000 00:10 2097 anon_inode:i915.gem -7df8030a6000-7df8030b5000 r--s 00000000 103:02 22051920 /home/koppe/.cache/fontconfig/491f45a0a771fef1c10b9b647a97fb82-le64.cache-9 -7df8030b5000-7df8030b6000 r--p 00000000 103:02 30952604 /usr/lib/libbrotlidec.so.1.1.0 -7df8030b6000-7df8030bf000 r-xp 00001000 103:02 30952604 /usr/lib/libbrotlidec.so.1.1.0 -7df8030bf000-7df8030c2000 r--p 0000a000 103:02 30952604 /usr/lib/libbrotlidec.so.1.1.0 -7df8030c2000-7df8030c3000 r--p 0000c000 103:02 30952604 /usr/lib/libbrotlidec.so.1.1.0 -7df8030c3000-7df8030c4000 rw-p 0000d000 103:02 30952604 /usr/lib/libbrotlidec.so.1.1.0 -7df8030c4000-7df8030c6000 r--p 00000000 103:02 30971568 /usr/lib/libgraphite2.so.3.2.1 -7df8030c6000-7df8030de000 r-xp 00002000 103:02 30971568 /usr/lib/libgraphite2.so.3.2.1 -7df8030de000-7df8030e3000 r--p 0001a000 103:02 30971568 /usr/lib/libgraphite2.so.3.2.1 -7df8030e3000-7df8030e5000 r--p 0001e000 103:02 30971568 /usr/lib/libgraphite2.so.3.2.1 -7df8030e5000-7df8030e6000 rw-p 00020000 103:02 30971568 /usr/lib/libgraphite2.so.3.2.1 -7df8030e6000-7df8030e7000 ---p 00000000 00:00 0 -7df8030e7000-7df8030eb000 ---p 00000000 00:00 0 -7df8030eb000-7df8031e7000 rw-p 00000000 00:00 0 -7df8031e7000-7df8031e8000 ---p 00000000 00:00 0 -7df8031e8000-7df8032e8000 rw-p 00000000 00:00 0 -7df8032e8000-7df8032e9000 ---p 00000000 00:00 0 -7df8032e9000-7df8033e9000 rw-p 00000000 00:00 0 -7df8033e9000-7df8033ea000 ---p 00000000 00:00 0 -7df8033ea000-7df8034ea000 rw-p 00000000 00:00 0 -7df8034ea000-7df8034eb000 ---p 00000000 00:00 0 -7df8034eb000-7df8035eb000 rw-p 00000000 00:00 0 -7df8035eb000-7df8035ec000 ---p 00000000 00:00 0 -7df8035ec000-7df8036ec000 rw-p 00000000 00:00 0 -7df8036ec000-7df8036ed000 ---p 00000000 00:00 0 -7df8036ed000-7df8037ed000 rw-p 00000000 00:00 0 -7df8037ed000-7df8037ee000 ---p 00000000 00:00 0 -7df8037ee000-7df8038ee000 rw-p 00000000 00:00 0 -7df8038ee000-7df8038ef000 ---p 00000000 00:00 0 -7df8038ef000-7df8039ef000 rw-p 00000000 00:00 0 -7df8039ef000-7df8039f0000 ---p 00000000 00:00 0 -7df8039f0000-7df803af0000 rw-p 00000000 00:00 0 -7df803af0000-7df803af1000 ---p 00000000 00:00 0 -7df803af1000-7df803bf1000 rw-p 00000000 00:00 0 -7df803bf1000-7df803bf2000 ---p 00000000 00:00 0 -7df803bf2000-7df803cf2000 rw-p 00000000 00:00 0 -7df803cf2000-7df803cf3000 ---p 00000000 00:00 0 -7df803cf3000-7df803cf7000 ---p 00000000 00:00 0 -7df803cf7000-7df803df3000 rw-p 00000000 00:00 0 -7df804000000-7df804021000 rw-p 00000000 00:00 0 -7df804021000-7df808000000 ---p 00000000 00:00 0 -7df808000000-7df808345000 rw-p 00000000 00:00 0 -7df808345000-7df80c000000 ---p 00000000 00:00 0 -7df80c004000-7df80c006000 r--s 00000000 103:02 22050691 /home/koppe/.cache/fontconfig/452f1fac34b224105d7acfae3034bcd5-le64.cache-9 -7df80c006000-7df80c009000 r--s 00000000 103:02 22051916 /home/koppe/.cache/fontconfig/6ba42ae0000f58711b5caaf10d690066-le64.cache-9 -7df80c009000-7df80c019000 rw-s 10bca1000 00:10 2097 anon_inode:i915.gem -7df80c019000-7df80c01d000 rw-s 10e1d8000 00:10 2097 anon_inode:i915.gem -7df80c01d000-7df80c01f000 rw-s 10e122000 00:10 2097 anon_inode:i915.gem -7df80c01f000-7df80c021000 rw-s 108761000 00:10 2097 anon_inode:i915.gem -7df80c024000-7df80c026000 r--p 00000000 103:02 30948778 /usr/lib/libbz2.so.1.0.8 -7df80c026000-7df80c033000 r-xp 00002000 103:02 30948778 /usr/lib/libbz2.so.1.0.8 -7df80c033000-7df80c035000 r--p 0000f000 103:02 30948778 /usr/lib/libbz2.so.1.0.8 -7df80c035000-7df80c036000 r--p 00010000 103:02 30948778 /usr/lib/libbz2.so.1.0.8 -7df80c036000-7df80c037000 rw-p 00011000 103:02 30948778 /usr/lib/libbz2.so.1.0.8 -7df80c037000-7df80c03a000 r--p 00000000 103:02 32271937 /usr/lib/jvm/java-21-openjdk/lib/libfontmanager.so -7df80c03a000-7df80c043000 r-xp 00003000 103:02 32271937 /usr/lib/jvm/java-21-openjdk/lib/libfontmanager.so -7df80c043000-7df80c045000 r--p 0000c000 103:02 32271937 /usr/lib/jvm/java-21-openjdk/lib/libfontmanager.so -7df80c045000-7df80c046000 r--p 0000d000 103:02 32271937 /usr/lib/jvm/java-21-openjdk/lib/libfontmanager.so -7df80c046000-7df80c047000 rw-p 0000e000 103:02 32271937 /usr/lib/jvm/java-21-openjdk/lib/libfontmanager.so -7df80c047000-7df80c049000 rw-s 10392d000 00:10 2097 anon_inode:i915.gem -7df80c049000-7df80c04b000 rw-s 1002b4000 00:10 2097 anon_inode:i915.gem -7df80c04b000-7df80c04d000 rw-s 10e14b000 00:10 2097 anon_inode:i915.gem -7df80c04d000-7df80c04f000 rw-s 10a89a000 00:10 2097 anon_inode:i915.gem -7df80c04f000-7df80c05f000 rw-s 10bc31000 00:10 2097 anon_inode:i915.gem -7df80c05f000-7df80c061000 rw-s 107645000 00:10 2097 anon_inode:i915.gem -7df80c061000-7df80c063000 rw-s 10a6b1000 00:10 2097 anon_inode:i915.gem -7df80c063000-7df80c065000 rw-s 108675000 00:10 2097 anon_inode:i915.gem -7df80c9f4000-7df80c9f5000 ---p 00000000 00:00 0 -7df80c9f5000-7df80d1f5000 rw-p 00000000 00:00 0 -7df80d1f5000-7df80d1f6000 ---p 00000000 00:00 0 -7df80d1f6000-7df80d9f6000 rw-p 00000000 00:00 0 -7df80e1f7000-7df80e1f8000 ---p 00000000 00:00 0 -7df80e1f8000-7df80e9f8000 rw-p 00000000 00:00 0 -7df80e9f8000-7df80e9fa000 r--p 00000000 103:02 31488204 /usr/lib/pipewire-0.3/libpipewire-module-session-manager.so -7df80e9fa000-7df80ea16000 r-xp 00002000 103:02 31488204 /usr/lib/pipewire-0.3/libpipewire-module-session-manager.so -7df80ea16000-7df80ea1b000 r--p 0001e000 103:02 31488204 /usr/lib/pipewire-0.3/libpipewire-module-session-manager.so -7df80ea1b000-7df80ea1d000 r--p 00022000 103:02 31488204 /usr/lib/pipewire-0.3/libpipewire-module-session-manager.so -7df80ea1d000-7df80ea1e000 rw-p 00024000 103:02 31488204 /usr/lib/pipewire-0.3/libpipewire-module-session-manager.so -7df80ea1e000-7df80ea20000 r--p 00000000 103:02 31488198 /usr/lib/pipewire-0.3/libpipewire-module-metadata.so -7df80ea20000-7df80ea28000 r-xp 00002000 103:02 31488198 /usr/lib/pipewire-0.3/libpipewire-module-metadata.so -7df80ea28000-7df80ea29000 r--p 0000a000 103:02 31488198 /usr/lib/pipewire-0.3/libpipewire-module-metadata.so -7df80ea29000-7df80ea2a000 r--p 0000b000 103:02 31488198 /usr/lib/pipewire-0.3/libpipewire-module-metadata.so -7df80ea2a000-7df80ea2b000 rw-p 0000c000 103:02 31488198 /usr/lib/pipewire-0.3/libpipewire-module-metadata.so -7df80ea2b000-7df80ea2e000 r--p 00000000 103:02 31488201 /usr/lib/pipewire-0.3/libpipewire-module-protocol-native.so -7df80ea2e000-7df80ea4f000 r-xp 00003000 103:02 31488201 /usr/lib/pipewire-0.3/libpipewire-module-protocol-native.so -7df80ea4f000-7df80ea5b000 r--p 00024000 103:02 31488201 /usr/lib/pipewire-0.3/libpipewire-module-protocol-native.so -7df80ea5b000-7df80ea6b000 r--p 0002f000 103:02 31488201 /usr/lib/pipewire-0.3/libpipewire-module-protocol-native.so -7df80ea6b000-7df80ea6c000 rw-p 0003f000 103:02 31488201 /usr/lib/pipewire-0.3/libpipewire-module-protocol-native.so -7df80ea6c000-7df80ea6d000 ---p 00000000 00:00 0 -7df80ea6d000-7df80f26d000 rw-p 00000000 00:00 0 -7df80f26d000-7df80f27b000 r--p 00000000 103:02 30956657 /usr/lib/libdbus-1.so.3.32.4 -7df80f27b000-7df80f2a9000 r-xp 0000e000 103:02 30956657 /usr/lib/libdbus-1.so.3.32.4 -7df80f2a9000-7df80f2bb000 r--p 0003c000 103:02 30956657 /usr/lib/libdbus-1.so.3.32.4 -7df80f2bb000-7df80f2bd000 r--p 0004e000 103:02 30956657 /usr/lib/libdbus-1.so.3.32.4 -7df80f2bd000-7df80f2be000 rw-p 00050000 103:02 30956657 /usr/lib/libdbus-1.so.3.32.4 -7df80f2be000-7df80f2cf000 r--p 00000000 103:02 30949476 /usr/lib/libsystemd.so.0.39.0 -7df80f2cf000-7df80f36e000 r-xp 00011000 103:02 30949476 /usr/lib/libsystemd.so.0.39.0 -7df80f36e000-7df80f3a4000 r--p 000b0000 103:02 30949476 /usr/lib/libsystemd.so.0.39.0 -7df80f3a4000-7df80f3b0000 r--p 000e5000 103:02 30949476 /usr/lib/libsystemd.so.0.39.0 -7df80f3b0000-7df80f3b1000 rw-p 000f1000 103:02 30949476 /usr/lib/libsystemd.so.0.39.0 -7df80f3b1000-7df80f3b2000 rw-p 00000000 00:00 0 -7df80f3b2000-7df80f3be000 r--p 00000000 103:02 31047383 /usr/lib/libpipewire-0.3.so.0.1207.0 -7df80f3be000-7df80f432000 r-xp 0000c000 103:02 31047383 /usr/lib/libpipewire-0.3.so.0.1207.0 -7df80f432000-7df80f44d000 r--p 00080000 103:02 31047383 /usr/lib/libpipewire-0.3.so.0.1207.0 -7df80f44d000-7df80f466000 r--p 0009a000 103:02 31047383 /usr/lib/libpipewire-0.3.so.0.1207.0 -7df80f466000-7df80f467000 rw-p 000b3000 103:02 31047383 /usr/lib/libpipewire-0.3.so.0.1207.0 -7df80f467000-7df80f468000 rw-p 00000000 00:00 0 -7df80f468000-7df80f47b000 r--p 00000000 00:22 556 /tmp/lwjgl_koppe/3.3.3+5/x64/libopenal.so -7df80f47b000-7df80f51b000 r-xp 00013000 00:22 556 /tmp/lwjgl_koppe/3.3.3+5/x64/libopenal.so -7df80f51b000-7df80f57d000 r--p 000b3000 00:22 556 /tmp/lwjgl_koppe/3.3.3+5/x64/libopenal.so -7df80f57d000-7df80f57e000 ---p 00115000 00:22 556 /tmp/lwjgl_koppe/3.3.3+5/x64/libopenal.so -7df80f57e000-7df80f583000 r--p 00115000 00:22 556 /tmp/lwjgl_koppe/3.3.3+5/x64/libopenal.so -7df80f583000-7df80f584000 rw-p 0011a000 00:22 556 /tmp/lwjgl_koppe/3.3.3+5/x64/libopenal.so -7df80f584000-7df80f5ff000 rw-p 00000000 00:00 0 -7df80f5ff000-7df80f7ff000 rw-s 10dcb2000 00:10 2097 anon_inode:i915.gem -7df80f7ff000-7df80f800000 ---p 00000000 00:00 0 -7df80f800000-7df810000000 rw-p 00000000 00:00 0 -7df810000000-7df810400000 rw-p 00000000 00:00 0 -7df810400000-7df8109c0000 rw-p 00000000 00:00 0 -7df8109c0000-7df810b00000 rw-p 00000000 00:00 0 -7df810b00000-7df810bc0000 rw-p 00000000 00:00 0 -7df810bc0000-7df810c00000 rw-p 00000000 00:00 0 -7df810c00000-7df810f00000 rw-p 00000000 00:00 0 -7df810f00000-7df810f20000 rw-p 00000000 00:00 0 -7df810f20000-7df810f40000 rw-p 00000000 00:00 0 -7df810f40000-7df810f80000 rw-p 00000000 00:00 0 -7df810f80000-7df811100000 rw-p 00000000 00:00 0 -7df811100000-7df811120000 rw-p 00000000 00:00 0 -7df811120000-7df811140000 rw-p 00000000 00:00 0 -7df811140000-7df811180000 rw-p 00000000 00:00 0 -7df811180000-7df811330000 rw-p 00000000 00:00 0 -7df811330000-7df811400000 ---p 00000000 00:00 0 -7df811400000-7df811500000 rw-p 00000000 00:00 0 -7df811500000-7df811520000 rw-p 00000000 00:00 0 -7df811520000-7df811540000 rw-p 00000000 00:00 0 -7df811540000-7df811580000 rw-p 00000000 00:00 0 -7df811580000-7df811700000 rw-p 00000000 00:00 0 -7df811700000-7df811730000 rw-p 00000000 00:00 0 -7df811730000-7df814000000 ---p 00000000 00:00 0 -7df814000000-7df814021000 rw-p 00000000 00:00 0 -7df814021000-7df818000000 ---p 00000000 00:00 0 -7df818001000-7df818003000 r--p 00000000 103:02 31488193 /usr/lib/pipewire-0.3/libpipewire-module-adapter.so -7df818003000-7df818007000 r-xp 00002000 103:02 31488193 /usr/lib/pipewire-0.3/libpipewire-module-adapter.so -7df818007000-7df81800a000 r--p 00006000 103:02 31488193 /usr/lib/pipewire-0.3/libpipewire-module-adapter.so -7df81800a000-7df81800d000 r--p 00008000 103:02 31488193 /usr/lib/pipewire-0.3/libpipewire-module-adapter.so -7df81800d000-7df81800e000 rw-p 0000b000 103:02 31488193 /usr/lib/pipewire-0.3/libpipewire-module-adapter.so -7df81800e000-7df818010000 r--p 00000000 103:02 31488194 /usr/lib/pipewire-0.3/libpipewire-module-client-device.so -7df818010000-7df818019000 r-xp 00002000 103:02 31488194 /usr/lib/pipewire-0.3/libpipewire-module-client-device.so -7df818019000-7df81801a000 r--p 0000b000 103:02 31488194 /usr/lib/pipewire-0.3/libpipewire-module-client-device.so -7df81801a000-7df81801b000 r--p 0000c000 103:02 31488194 /usr/lib/pipewire-0.3/libpipewire-module-client-device.so -7df81801b000-7df81801c000 rw-p 0000d000 103:02 31488194 /usr/lib/pipewire-0.3/libpipewire-module-client-device.so -7df81801c000-7df818021000 r--p 00000000 103:02 32271929 /usr/lib/jvm/java-21-openjdk/lib/libawt.so -7df818021000-7df8180c0000 r-xp 00005000 103:02 32271929 /usr/lib/jvm/java-21-openjdk/lib/libawt.so -7df8180c0000-7df8180cc000 r--p 000a4000 103:02 32271929 /usr/lib/jvm/java-21-openjdk/lib/libawt.so -7df8180cc000-7df8180cd000 r--p 000b0000 103:02 32271929 /usr/lib/jvm/java-21-openjdk/lib/libawt.so -7df8180cd000-7df8180d8000 rw-p 000b1000 103:02 32271929 /usr/lib/jvm/java-21-openjdk/lib/libawt.so -7df8180d8000-7df8180fd000 rw-p 00000000 00:00 0 -7df8180fd000-7df8180fe000 ---p 00000000 00:00 0 -7df8180fe000-7df818102000 ---p 00000000 00:00 0 -7df818102000-7df8181fe000 rw-p 00000000 00:00 0 -7df8181fe000-7df8181ff000 ---p 00000000 00:00 0 -7df8181ff000-7df8189ff000 rw-p 00000000 00:00 0 -7df8189ff000-7df818a00000 ---p 00000000 00:00 0 -7df818a00000-7df819200000 rw-p 00000000 00:00 0 -7df819200000-7df81af50000 r--p 00000000 103:02 30950776 /usr/lib/libicudata.so.75.1 -7df81af50000-7df81af51000 r--p 01d4f000 103:02 30950776 /usr/lib/libicudata.so.75.1 -7df81af52000-7df81af54000 rw-s 107ddc000 00:10 2097 anon_inode:i915.gem -7df81af5d000-7df81af60000 r--p 00000000 103:02 31488195 /usr/lib/pipewire-0.3/libpipewire-module-client-node.so -7df81af60000-7df81af81000 r-xp 00003000 103:02 31488195 /usr/lib/pipewire-0.3/libpipewire-module-client-node.so -7df81af81000-7df81af87000 r--p 00024000 103:02 31488195 /usr/lib/pipewire-0.3/libpipewire-module-client-node.so -7df81af87000-7df81af89000 r--p 0002a000 103:02 31488195 /usr/lib/pipewire-0.3/libpipewire-module-client-node.so -7df81af89000-7df81af8a000 rw-p 0002c000 103:02 31488195 /usr/lib/pipewire-0.3/libpipewire-module-client-node.so -7df81af8a000-7df81af8c000 r--p 00000000 103:02 31488202 /usr/lib/pipewire-0.3/libpipewire-module-rt.so -7df81af8c000-7df81af90000 r-xp 00002000 103:02 31488202 /usr/lib/pipewire-0.3/libpipewire-module-rt.so -7df81af90000-7df81af92000 r--p 00006000 103:02 31488202 /usr/lib/pipewire-0.3/libpipewire-module-rt.so -7df81af92000-7df81af93000 r--p 00007000 103:02 31488202 /usr/lib/pipewire-0.3/libpipewire-module-rt.so -7df81af93000-7df81af94000 rw-p 00008000 103:02 31488202 /usr/lib/pipewire-0.3/libpipewire-module-rt.so -7df81af94000-7df81afa2000 r--p 00000000 103:02 32271932 /usr/lib/jvm/java-21-openjdk/lib/libawt_xawt.so -7df81afa2000-7df81afe7000 r-xp 0000e000 103:02 32271932 /usr/lib/jvm/java-21-openjdk/lib/libawt_xawt.so -7df81afe7000-7df81affb000 r--p 00053000 103:02 32271932 /usr/lib/jvm/java-21-openjdk/lib/libawt_xawt.so -7df81affb000-7df81affd000 r--p 00066000 103:02 32271932 /usr/lib/jvm/java-21-openjdk/lib/libawt_xawt.so -7df81affd000-7df81affe000 rw-p 00068000 103:02 32271932 /usr/lib/jvm/java-21-openjdk/lib/libawt_xawt.so -7df81affe000-7df81b000000 rw-p 00000000 00:00 0 -7df81b000000-7df81bc97000 rw-p 00001000 103:02 32272107 /usr/lib/jvm/java-21-openjdk/lib/server/classes.jsa -7df81bc97000-7df81c000000 ---p 00000000 00:00 0 -7df81c000000-7df81c040000 rw-p 00000000 00:00 0 -7df81c040000-7df81c080000 rw-p 00000000 00:00 0 -7df81c080000-7df81c100000 rw-p 00000000 00:00 0 -7df81c100000-7df81c160000 rw-p 00000000 00:00 0 -7df81c160000-7df81c1c0000 rw-p 00000000 00:00 0 -7df81c1c0000-7df81c1e0000 rw-p 00000000 00:00 0 -7df81c1e0000-7df81c240000 rw-p 00000000 00:00 0 -7df81c240000-7df81c260000 rw-p 00000000 00:00 0 -7df81c260000-7df81c280000 rw-p 00000000 00:00 0 -7df81c280000-7df85c000000 ---p 00000000 00:00 0 -7df85c000000-7df85c021000 rw-p 00000000 00:00 0 -7df85c021000-7df860000000 ---p 00000000 00:00 0 -7df860000000-7df860021000 rw-p 00000000 00:00 0 -7df860021000-7df864000000 ---p 00000000 00:00 0 -7df864000000-7df864002000 rw-s 10f82f000 00:10 2097 anon_inode:i915.gem -7df864002000-7df864004000 rw-s 107657000 00:10 2097 anon_inode:i915.gem -7df864004000-7df864005000 r--p 00000000 103:02 31488210 /usr/lib/spa-0.2/support/libspa-dbus.so -7df864005000-7df864008000 r-xp 00001000 103:02 31488210 /usr/lib/spa-0.2/support/libspa-dbus.so -7df864008000-7df864009000 r--p 00004000 103:02 31488210 /usr/lib/spa-0.2/support/libspa-dbus.so -7df864009000-7df86400a000 r--p 00004000 103:02 31488210 /usr/lib/spa-0.2/support/libspa-dbus.so -7df86400a000-7df86400b000 rw-p 00005000 103:02 31488210 /usr/lib/spa-0.2/support/libspa-dbus.so -7df86400b000-7df86400e000 r--p 00000000 103:02 30948002 /usr/lib/libcap.so.2.71 -7df86400e000-7df864013000 r-xp 00003000 103:02 30948002 /usr/lib/libcap.so.2.71 -7df864013000-7df864015000 r--p 00008000 103:02 30948002 /usr/lib/libcap.so.2.71 -7df864015000-7df864016000 r--p 00009000 103:02 30948002 /usr/lib/libcap.so.2.71 -7df864016000-7df864017000 rw-p 0000a000 103:02 30948002 /usr/lib/libcap.so.2.71 -7df864017000-7df864019000 r--p 00000000 103:02 31488212 /usr/lib/spa-0.2/support/libspa-support.so -7df864019000-7df864030000 r-xp 00002000 103:02 31488212 /usr/lib/spa-0.2/support/libspa-support.so -7df864030000-7df864035000 r--p 00019000 103:02 31488212 /usr/lib/spa-0.2/support/libspa-support.so -7df864035000-7df864037000 r--p 0001e000 103:02 31488212 /usr/lib/spa-0.2/support/libspa-support.so -7df864037000-7df864038000 rw-p 00020000 103:02 31488212 /usr/lib/spa-0.2/support/libspa-support.so -7df864038000-7df864048000 rw-s 10bf71000 00:10 2097 anon_inode:i915.gem -7df864048000-7df864049000 ---p 00000000 00:00 0 -7df864049000-7df86404d000 ---p 00000000 00:00 0 -7df86404d000-7df864149000 rw-p 00000000 00:00 0 -7df864149000-7df86417c000 r--p 00000000 00:22 555 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl_opengl.so -7df86417c000-7df864190000 r-xp 00033000 00:22 555 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl_opengl.so -7df864190000-7df8641a0000 r--p 00047000 00:22 555 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl_opengl.so -7df8641a0000-7df8641a1000 r--p 00056000 00:22 555 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl_opengl.so -7df8641a1000-7df8641a2000 rw-p 00057000 00:22 555 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl_opengl.so -7df8641a2000-7df8641c2000 rw-s 10e0a2000 00:10 2097 anon_inode:i915.gem -7df8641c2000-7df8641d2000 rw-s 10bfd1000 00:10 2097 anon_inode:i915.gem -7df8641d2000-7df8641e2000 rw-s 108585000 00:10 2097 anon_inode:i915.gem -7df8641e2000-7df8641f2000 rw-s 10df82000 00:10 2097 anon_inode:i915.gem -7df8642bd000-7df8642dd000 rw-s 108565000 00:10 2097 anon_inode:i915.gem -7df8642dd000-7df8642fd000 rw-s 10961f000 00:10 2097 anon_inode:i915.gem -7df8642fd000-7df86437d000 rw-s 10508f000 00:10 2097 anon_inode:i915.gem -7df86437d000-7df86437e000 ---p 00000000 00:00 0 -7df86437e000-7df864b7e000 rw-p 00000000 00:00 0 -7df864b7e000-7df864cbf000 rw-s 00000000 103:02 22315949 /home/koppe/.cache/mesa_shader_cache_db/index -7df864cbf000-7df864cff000 rw-s 113b91000 00:10 2097 anon_inode:i915.gem -7df864cff000-7df864eff000 rw-s 10d431000 00:10 2097 anon_inode:i915.gem -7df864eff000-7df864f46000 r--p 00000000 103:02 30950794 /usr/lib/libicuuc.so.75.1 -7df864f46000-7df865058000 r-xp 00047000 103:02 30950794 /usr/lib/libicuuc.so.75.1 -7df865058000-7df8650e3000 r--p 00159000 103:02 30950794 /usr/lib/libicuuc.so.75.1 -7df8650e3000-7df8650f6000 r--p 001e4000 103:02 30950794 /usr/lib/libicuuc.so.75.1 -7df8650f6000-7df8650f7000 rw-p 001f7000 103:02 30950794 /usr/lib/libicuuc.so.75.1 -7df8650f7000-7df8650f9000 rw-p 00000000 00:00 0 -7df8650f9000-7df8650fc000 r--p 00000000 103:02 30948492 /usr/lib/liblzma.so.5.6.3 -7df8650fc000-7df86511f000 r-xp 00003000 103:02 30948492 /usr/lib/liblzma.so.5.6.3 -7df86511f000-7df86512a000 r--p 00026000 103:02 30948492 /usr/lib/liblzma.so.5.6.3 -7df86512a000-7df86512b000 r--p 00031000 103:02 30948492 /usr/lib/liblzma.so.5.6.3 -7df86512b000-7df86512c000 rw-p 00032000 103:02 30948492 /usr/lib/liblzma.so.5.6.3 -7df86512c000-7df86514d000 r--p 00000000 103:02 30950866 /usr/lib/libxml2.so.2.13.5 -7df86514d000-7df865231000 r-xp 00021000 103:02 30950866 /usr/lib/libxml2.so.2.13.5 -7df865231000-7df86526c000 r--p 00105000 103:02 30950866 /usr/lib/libxml2.so.2.13.5 -7df86526c000-7df865277000 r--p 00140000 103:02 30950866 /usr/lib/libxml2.so.2.13.5 -7df865277000-7df865278000 rw-p 0014b000 103:02 30950866 /usr/lib/libxml2.so.2.13.5 -7df865278000-7df865279000 rw-p 00000000 00:00 0 -7df865279000-7df865286000 r--p 00000000 103:02 30937275 /usr/lib/libncursesw.so.6.5 -7df865286000-7df8652cd000 r-xp 0000d000 103:02 30937275 /usr/lib/libncursesw.so.6.5 -7df8652cd000-7df8652e3000 r--p 00054000 103:02 30937275 /usr/lib/libncursesw.so.6.5 -7df8652e3000-7df8652e7000 r--p 0006a000 103:02 30937275 /usr/lib/libncursesw.so.6.5 -7df8652e7000-7df8652e8000 rw-p 0006e000 103:02 30937275 /usr/lib/libncursesw.so.6.5 -7df8652e8000-7df8652ee000 r--p 00000000 103:02 30967715 /usr/lib/libedit.so.0.0.73 -7df8652ee000-7df86530e000 r-xp 00006000 103:02 30967715 /usr/lib/libedit.so.0.0.73 -7df86530e000-7df86531b000 r--p 00026000 103:02 30967715 /usr/lib/libedit.so.0.0.73 -7df86531b000-7df86531d000 r--p 00033000 103:02 30967715 /usr/lib/libedit.so.0.0.73 -7df86531d000-7df86531e000 rw-p 00035000 103:02 30967715 /usr/lib/libedit.so.0.0.73 -7df86531e000-7df865321000 rw-p 00000000 00:00 0 -7df865321000-7df86532d000 r--p 00000000 103:02 30948866 /usr/lib/libzstd.so.1.5.6 -7df86532d000-7df8653ed000 r-xp 0000c000 103:02 30948866 /usr/lib/libzstd.so.1.5.6 -7df8653ed000-7df8653fe000 r--p 000cc000 103:02 30948866 /usr/lib/libzstd.so.1.5.6 -7df8653fe000-7df8653ff000 r--p 000dd000 103:02 30948866 /usr/lib/libzstd.so.1.5.6 -7df8653ff000-7df865400000 rw-p 000de000 103:02 30948866 /usr/lib/libzstd.so.1.5.6 -7df865400000-7df865415000 r--p 00000000 103:02 31037736 /usr/lib/libgallium-24.2.7-arch1.1.so -7df865415000-7df866ae4000 r-xp 00015000 103:02 31037736 /usr/lib/libgallium-24.2.7-arch1.1.so -7df866ae4000-7df867870000 r--p 016e4000 103:02 31037736 /usr/lib/libgallium-24.2.7-arch1.1.so -7df867870000-7df867928000 r--p 0246f000 103:02 31037736 /usr/lib/libgallium-24.2.7-arch1.1.so -7df867928000-7df86793f000 rw-p 02527000 103:02 31037736 /usr/lib/libgallium-24.2.7-arch1.1.so -7df86793f000-7df867b03000 rw-p 00000000 00:00 0 -7df867b04000-7df867b05000 r--p 00000000 103:02 32271969 /usr/lib/jvm/java-21-openjdk/lib/libprefs.so -7df867b05000-7df867b06000 r-xp 00001000 103:02 32271969 /usr/lib/jvm/java-21-openjdk/lib/libprefs.so -7df867b06000-7df867b07000 r--p 00002000 103:02 32271969 /usr/lib/jvm/java-21-openjdk/lib/libprefs.so -7df867b07000-7df867b08000 r--p 00002000 103:02 32271969 /usr/lib/jvm/java-21-openjdk/lib/libprefs.so -7df867b08000-7df867b09000 rw-p 00003000 103:02 32271969 /usr/lib/jvm/java-21-openjdk/lib/libprefs.so -7df867b09000-7df867b0b000 r--p 00000000 103:02 30976783 /usr/lib/libXtst.so.6.1.0 -7df867b0b000-7df867b0e000 r-xp 00002000 103:02 30976783 /usr/lib/libXtst.so.6.1.0 -7df867b0e000-7df867b0f000 r--p 00005000 103:02 30976783 /usr/lib/libXtst.so.6.1.0 -7df867b0f000-7df867b10000 r--p 00005000 103:02 30976783 /usr/lib/libXtst.so.6.1.0 -7df867b10000-7df867b11000 rw-p 00006000 103:02 30976783 /usr/lib/libXtst.so.6.1.0 -7df867b11000-7df867b21000 rw-s 10bbc1000 00:10 2097 anon_inode:i915.gem -7df867b21000-7df867b23000 r--p 00000000 103:02 30971276 /usr/lib/libpciaccess.so.0.11.1 -7df867b23000-7df867b28000 r-xp 00002000 103:02 30971276 /usr/lib/libpciaccess.so.0.11.1 -7df867b28000-7df867b2a000 r--p 00007000 103:02 30971276 /usr/lib/libpciaccess.so.0.11.1 -7df867b2a000-7df867b2b000 r--p 00008000 103:02 30971276 /usr/lib/libpciaccess.so.0.11.1 -7df867b2b000-7df867b2c000 rw-p 00009000 103:02 30971276 /usr/lib/libpciaccess.so.0.11.1 -7df867b2c000-7df867b2e000 r--p 00000000 103:02 30952381 /usr/lib/libffi.so.8.1.4 -7df867b2e000-7df867b34000 r-xp 00002000 103:02 30952381 /usr/lib/libffi.so.8.1.4 -7df867b34000-7df867b35000 r--p 00008000 103:02 30952381 /usr/lib/libffi.so.8.1.4 -7df867b35000-7df867b36000 r--p 00009000 103:02 30952381 /usr/lib/libffi.so.8.1.4 -7df867b36000-7df867b37000 rw-p 0000a000 103:02 30952381 /usr/lib/libffi.so.8.1.4 -7df867b37000-7df867b3a000 r--p 00000000 103:02 30955393 /usr/lib/libdrm_intel.so.1.123.0 -7df867b3a000-7df867b50000 r-xp 00003000 103:02 30955393 /usr/lib/libdrm_intel.so.1.123.0 -7df867b50000-7df867b59000 r--p 00019000 103:02 30955393 /usr/lib/libdrm_intel.so.1.123.0 -7df867b59000-7df867b5a000 r--p 00022000 103:02 30955393 /usr/lib/libdrm_intel.so.1.123.0 -7df867b5a000-7df867b5b000 rw-p 00023000 103:02 30955393 /usr/lib/libdrm_intel.so.1.123.0 -7df867b5b000-7df867b5e000 r--p 00000000 103:02 30955388 /usr/lib/libdrm_amdgpu.so.1.123.0 -7df867b5e000-7df867b63000 r-xp 00003000 103:02 30955388 /usr/lib/libdrm_amdgpu.so.1.123.0 -7df867b63000-7df867b65000 r--p 00008000 103:02 30955388 /usr/lib/libdrm_amdgpu.so.1.123.0 -7df867b65000-7df867b66000 r--p 00009000 103:02 30955388 /usr/lib/libdrm_amdgpu.so.1.123.0 -7df867b66000-7df867b67000 rw-p 0000a000 103:02 30955388 /usr/lib/libdrm_amdgpu.so.1.123.0 -7df867b67000-7df867b6a000 r--p 00000000 103:02 30957499 /usr/lib/libelf-0.192.so -7df867b6a000-7df867b7d000 r-xp 00003000 103:02 30957499 /usr/lib/libelf-0.192.so -7df867b7d000-7df867b81000 r--p 00016000 103:02 30957499 /usr/lib/libelf-0.192.so -7df867b81000-7df867b82000 r--p 00019000 103:02 30957499 /usr/lib/libelf-0.192.so -7df867b82000-7df867b83000 rw-p 0001a000 103:02 30957499 /usr/lib/libelf-0.192.so -7df867b83000-7df867b85000 r--p 00000000 103:02 30955399 /usr/lib/libdrm_radeon.so.1.123.0 -7df867b85000-7df867b8b000 r-xp 00002000 103:02 30955399 /usr/lib/libdrm_radeon.so.1.123.0 -7df867b8b000-7df867b8f000 r--p 00008000 103:02 30955399 /usr/lib/libdrm_radeon.so.1.123.0 -7df867b8f000-7df867b90000 r--p 0000b000 103:02 30955399 /usr/lib/libdrm_radeon.so.1.123.0 -7df867b90000-7df867b91000 rw-p 0000c000 103:02 30955399 /usr/lib/libdrm_radeon.so.1.123.0 -7df867b91000-7df867b93000 r--p 00000000 103:02 30971427 /usr/lib/libsensors.so.5.0.0 -7df867b93000-7df867b9a000 r-xp 00002000 103:02 30971427 /usr/lib/libsensors.so.5.0.0 -7df867b9a000-7df867b9e000 r--p 00009000 103:02 30971427 /usr/lib/libsensors.so.5.0.0 -7df867b9e000-7df867b9f000 r--p 0000d000 103:02 30971427 /usr/lib/libsensors.so.5.0.0 -7df867b9f000-7df867ba0000 rw-p 0000e000 103:02 30971427 /usr/lib/libsensors.so.5.0.0 -7df867ba0000-7df867ba3000 r--p 00000000 103:02 30968067 /usr/lib/libxcb-xfixes.so.0.0.0 -7df867ba3000-7df867ba6000 r-xp 00003000 103:02 30968067 /usr/lib/libxcb-xfixes.so.0.0.0 -7df867ba6000-7df867ba7000 r--p 00006000 103:02 30968067 /usr/lib/libxcb-xfixes.so.0.0.0 -7df867ba7000-7df867ba8000 r--p 00007000 103:02 30968067 /usr/lib/libxcb-xfixes.so.0.0.0 -7df867ba8000-7df867ba9000 rw-p 00008000 103:02 30968067 /usr/lib/libxcb-xfixes.so.0.0.0 -7df867ba9000-7df867bac000 r--p 00000000 103:02 30968061 /usr/lib/libxcb-sync.so.1.0.0 -7df867bac000-7df867baf000 r-xp 00003000 103:02 30968061 /usr/lib/libxcb-sync.so.1.0.0 -7df867baf000-7df867bb0000 r--p 00006000 103:02 30968061 /usr/lib/libxcb-sync.so.1.0.0 -7df867bb0000-7df867bb1000 r--p 00007000 103:02 30968061 /usr/lib/libxcb-sync.so.1.0.0 -7df867bb1000-7df867bb2000 rw-p 00008000 103:02 30968061 /usr/lib/libxcb-sync.so.1.0.0 -7df867bb2000-7df867bb4000 r--p 00000000 103:02 30968011 /usr/lib/libxcb-dri3.so.0.1.0 -7df867bb4000-7df867bb6000 r-xp 00002000 103:02 30968011 /usr/lib/libxcb-dri3.so.0.1.0 -7df867bb6000-7df867bb7000 r--p 00004000 103:02 30968011 /usr/lib/libxcb-dri3.so.0.1.0 -7df867bb7000-7df867bb8000 r--p 00004000 103:02 30968011 /usr/lib/libxcb-dri3.so.0.1.0 -7df867bb8000-7df867bb9000 rw-p 00005000 103:02 30968011 /usr/lib/libxcb-dri3.so.0.1.0 -7df867bb9000-7df867bbb000 r--p 00000000 103:02 30952306 /usr/lib/libexpat.so.1.10.0 -7df867bbb000-7df867bd8000 r-xp 00002000 103:02 30952306 /usr/lib/libexpat.so.1.10.0 -7df867bd8000-7df867be0000 r--p 0001f000 103:02 30952306 /usr/lib/libexpat.so.1.10.0 -7df867be0000-7df867be2000 r--p 00026000 103:02 30952306 /usr/lib/libexpat.so.1.10.0 -7df867be2000-7df867be3000 rw-p 00028000 103:02 30952306 /usr/lib/libexpat.so.1.10.0 -7df867be3000-7df867bef000 r--p 00000000 103:02 30968016 /usr/lib/libxcb-glx.so.0.0.0 -7df867bef000-7df867bf8000 r-xp 0000c000 103:02 30968016 /usr/lib/libxcb-glx.so.0.0.0 -7df867bf8000-7df867bfd000 r--p 00015000 103:02 30968016 /usr/lib/libxcb-glx.so.0.0.0 -7df867bfd000-7df867bff000 r--p 0001a000 103:02 30968016 /usr/lib/libxcb-glx.so.0.0.0 -7df867bff000-7df867c00000 rw-p 0001c000 103:02 30968016 /usr/lib/libxcb-glx.so.0.0.0 -7df867c00000-7df868000000 rw-p 00000000 00:00 0 -7df868000000-7df868021000 rw-p 00000000 00:00 0 -7df868021000-7df86c000000 ---p 00000000 00:00 0 -7df86c000000-7df86c021000 rw-p 00000000 00:00 0 -7df86c021000-7df870000000 ---p 00000000 00:00 0 -7df870001000-7df870008000 r--p 00000000 103:02 30968028 /usr/lib/libxcb-randr.so.0.1.0 -7df870008000-7df87000e000 r-xp 00007000 103:02 30968028 /usr/lib/libxcb-randr.so.0.1.0 -7df87000e000-7df870011000 r--p 0000d000 103:02 30968028 /usr/lib/libxcb-randr.so.0.1.0 -7df870011000-7df870012000 r--p 00010000 103:02 30968028 /usr/lib/libxcb-randr.so.0.1.0 -7df870012000-7df870013000 rw-p 00011000 103:02 30968028 /usr/lib/libxcb-randr.so.0.1.0 -7df870013000-7df870018000 r--p 00000000 103:02 30955385 /usr/lib/libdrm.so.2.123.0 -7df870018000-7df870024000 r-xp 00005000 103:02 30955385 /usr/lib/libdrm.so.2.123.0 -7df870024000-7df870028000 r--p 00011000 103:02 30955385 /usr/lib/libdrm.so.2.123.0 -7df870028000-7df870029000 r--p 00015000 103:02 30955385 /usr/lib/libdrm.so.2.123.0 -7df870029000-7df87002a000 rw-p 00016000 103:02 30955385 /usr/lib/libdrm.so.2.123.0 -7df87002a000-7df87002b000 r--p 00000000 103:02 31041944 /usr/lib/libglapi.so.0.0.0 -7df87002b000-7df870039000 r-xp 00001000 103:02 31041944 /usr/lib/libglapi.so.0.0.0 -7df870039000-7df87004d000 r--p 0000f000 103:02 31041944 /usr/lib/libglapi.so.0.0.0 -7df87004d000-7df870051000 r--p 00023000 103:02 31041944 /usr/lib/libglapi.so.0.0.0 -7df870051000-7df870052000 rw-p 00027000 103:02 31041944 /usr/lib/libglapi.so.0.0.0 -7df870052000-7df870068000 r--p 00000000 103:02 31003549 /usr/lib/libGLX_mesa.so.0.0.0 -7df870068000-7df8700a7000 r-xp 00016000 103:02 31003549 /usr/lib/libGLX_mesa.so.0.0.0 -7df8700a7000-7df8700ba000 r--p 00055000 103:02 31003549 /usr/lib/libGLX_mesa.so.0.0.0 -7df8700ba000-7df8700be000 r--p 00067000 103:02 31003549 /usr/lib/libGLX_mesa.so.0.0.0 -7df8700be000-7df8700bf000 rw-p 0006b000 103:02 31003549 /usr/lib/libGLX_mesa.so.0.0.0 -7df8700bf000-7df8700d6000 r--p 00000000 103:02 30970401 /usr/lib/libX11.so.6.4.0 -7df8700d6000-7df87016a000 r-xp 00017000 103:02 30970401 /usr/lib/libX11.so.6.4.0 -7df87016a000-7df8701f9000 r--p 000ab000 103:02 30970401 /usr/lib/libX11.so.6.4.0 -7df8701f9000-7df8701fc000 r--p 00139000 103:02 30970401 /usr/lib/libX11.so.6.4.0 -7df8701fc000-7df870200000 rw-p 0013c000 103:02 30970401 /usr/lib/libX11.so.6.4.0 -7df870200000-7df870600000 rw-p 00000000 00:00 0 -7df870600000-7df870601000 r--p 00000000 103:02 30968023 /usr/lib/libxcb-present.so.0.0.0 -7df870601000-7df870602000 r-xp 00001000 103:02 30968023 /usr/lib/libxcb-present.so.0.0.0 -7df870602000-7df870603000 r--p 00002000 103:02 30968023 /usr/lib/libxcb-present.so.0.0.0 -7df870603000-7df870604000 r--p 00002000 103:02 30968023 /usr/lib/libxcb-present.so.0.0.0 -7df870604000-7df870605000 rw-p 00003000 103:02 30968023 /usr/lib/libxcb-present.so.0.0.0 -7df870605000-7df870606000 r--p 00000000 103:02 30971387 /usr/lib/libxshmfence.so.1.0.0 -7df870606000-7df870607000 r-xp 00001000 103:02 30971387 /usr/lib/libxshmfence.so.1.0.0 -7df870607000-7df870608000 r--p 00002000 103:02 30971387 /usr/lib/libxshmfence.so.1.0.0 -7df870608000-7df870609000 r--p 00002000 103:02 30971387 /usr/lib/libxshmfence.so.1.0.0 -7df870609000-7df87060a000 rw-p 00003000 103:02 30971387 /usr/lib/libxshmfence.so.1.0.0 -7df87060a000-7df87060b000 r--p 00000000 103:02 30968057 /usr/lib/libxcb-shm.so.0.0.0 -7df87060b000-7df87060c000 r-xp 00001000 103:02 30968057 /usr/lib/libxcb-shm.so.0.0.0 -7df87060c000-7df87060d000 r--p 00002000 103:02 30968057 /usr/lib/libxcb-shm.so.0.0.0 -7df87060d000-7df87060e000 r--p 00002000 103:02 30968057 /usr/lib/libxcb-shm.so.0.0.0 -7df87060e000-7df87060f000 rw-p 00003000 103:02 30968057 /usr/lib/libxcb-shm.so.0.0.0 -7df87060f000-7df870611000 r--p 00000000 103:02 30968004 /usr/lib/libxcb-dri2.so.0.0.0 -7df870611000-7df870613000 r-xp 00002000 103:02 30968004 /usr/lib/libxcb-dri2.so.0.0.0 -7df870613000-7df870614000 r--p 00004000 103:02 30968004 /usr/lib/libxcb-dri2.so.0.0.0 -7df870614000-7df870615000 r--p 00004000 103:02 30968004 /usr/lib/libxcb-dri2.so.0.0.0 -7df870615000-7df870616000 rw-p 00005000 103:02 30968004 /usr/lib/libxcb-dri2.so.0.0.0 -7df870616000-7df870657000 r--p 00000000 103:02 30971536 /usr/lib/libGLdispatch.so.0.0.0 -7df870657000-7df870696000 r-xp 00041000 103:02 30971536 /usr/lib/libGLdispatch.so.0.0.0 -7df870696000-7df8706a9000 r--p 00080000 103:02 30971536 /usr/lib/libGLdispatch.so.0.0.0 -7df8706a9000-7df8706c5000 r--p 00093000 103:02 30971536 /usr/lib/libGLdispatch.so.0.0.0 -7df8706c5000-7df8706c6000 rw-p 000af000 103:02 30971536 /usr/lib/libGLdispatch.so.0.0.0 -7df8706c6000-7df8706ce000 rw-p 00000000 00:00 0 -7df8706ce000-7df8706d1000 r--p 00000000 103:02 30971533 /usr/lib/libGLX.so.0.0.0 -7df8706d1000-7df8706eb000 r-xp 00003000 103:02 30971533 /usr/lib/libGLX.so.0.0.0 -7df8706eb000-7df8706ee000 r--p 0001d000 103:02 30971533 /usr/lib/libGLX.so.0.0.0 -7df8706ee000-7df8706ef000 r--p 00020000 103:02 30971533 /usr/lib/libGLX.so.0.0.0 -7df8706ef000-7df8706f0000 rw-p 00021000 103:02 30971533 /usr/lib/libGLX.so.0.0.0 -7df8706f0000-7df870700000 rw-p 00000000 00:00 0 -7df870700000-7df870703000 r--p 00000000 103:02 30981319 /usr/lib/libXcursor.so.1.0.2 -7df870703000-7df870709000 r-xp 00003000 103:02 30981319 /usr/lib/libXcursor.so.1.0.2 -7df870709000-7df87070b000 r--p 00009000 103:02 30981319 /usr/lib/libXcursor.so.1.0.2 -7df87070b000-7df87070c000 r--p 0000a000 103:02 30981319 /usr/lib/libXcursor.so.1.0.2 -7df87070c000-7df87070d000 rw-p 0000b000 103:02 30981319 /usr/lib/libXcursor.so.1.0.2 -7df87070d000-7df87070f000 r--p 00000000 103:02 30972241 /usr/lib/libXrender.so.1.3.0 -7df87070f000-7df870716000 r-xp 00002000 103:02 30972241 /usr/lib/libXrender.so.1.3.0 -7df870716000-7df870717000 r--p 00009000 103:02 30972241 /usr/lib/libXrender.so.1.3.0 -7df870717000-7df870718000 r--p 00009000 103:02 30972241 /usr/lib/libXrender.so.1.3.0 -7df870718000-7df870719000 rw-p 0000a000 103:02 30972241 /usr/lib/libXrender.so.1.3.0 -7df870719000-7df870727000 r--p 00000000 00:22 554 /tmp/lwjgl_koppe/3.3.3+5/x64/libglfw.so -7df870727000-7df870746000 r-xp 0000e000 00:22 554 /tmp/lwjgl_koppe/3.3.3+5/x64/libglfw.so -7df870746000-7df870779000 r--p 0002d000 00:22 554 /tmp/lwjgl_koppe/3.3.3+5/x64/libglfw.so -7df870779000-7df87077a000 ---p 00060000 00:22 554 /tmp/lwjgl_koppe/3.3.3+5/x64/libglfw.so -7df87077a000-7df87077d000 r--p 00060000 00:22 554 /tmp/lwjgl_koppe/3.3.3+5/x64/libglfw.so -7df87077d000-7df870780000 rw-p 00063000 00:22 554 /tmp/lwjgl_koppe/3.3.3+5/x64/libglfw.so -7df870780000-7df8707a3000 rw-p 00000000 00:00 0 -7df8707a3000-7df8707ab000 r--p 00000000 00:22 553 /tmp/lwjgl_koppe/3.3.3+5/x64/libjemalloc.so -7df8707ab000-7df870800000 r-xp 00008000 00:22 553 /tmp/lwjgl_koppe/3.3.3+5/x64/libjemalloc.so -7df870800000-7df870810000 r--p 0005d000 00:22 553 /tmp/lwjgl_koppe/3.3.3+5/x64/libjemalloc.so -7df870810000-7df870811000 ---p 0006d000 00:22 553 /tmp/lwjgl_koppe/3.3.3+5/x64/libjemalloc.so -7df870811000-7df870817000 r--p 0006d000 00:22 553 /tmp/lwjgl_koppe/3.3.3+5/x64/libjemalloc.so -7df870817000-7df870818000 rw-p 00073000 00:22 553 /tmp/lwjgl_koppe/3.3.3+5/x64/libjemalloc.so -7df870818000-7df870a22000 rw-p 00000000 00:00 0 -7df870a22000-7df870a23000 ---p 00000000 00:00 0 -7df870a23000-7df870a27000 ---p 00000000 00:00 0 -7df870a27000-7df870b23000 rw-p 00000000 00:00 0 -7df870b23000-7df870b24000 ---p 00000000 00:00 0 -7df870b24000-7df870b28000 ---p 00000000 00:00 0 -7df870b28000-7df870c24000 rw-p 00000000 00:00 0 -7df870c24000-7df870c25000 ---p 00000000 00:00 0 -7df870c25000-7df870c29000 ---p 00000000 00:00 0 -7df870c29000-7df870d25000 rw-p 00000000 00:00 0 -7df870d25000-7df870d26000 ---p 00000000 00:00 0 -7df870d26000-7df870d2a000 ---p 00000000 00:00 0 -7df870d2a000-7df870e26000 rw-p 00000000 00:00 0 -7df870e26000-7df870e27000 ---p 00000000 00:00 0 -7df870e27000-7df870e2b000 ---p 00000000 00:00 0 -7df870e2b000-7df870f27000 rw-p 00000000 00:00 0 -7df870f27000-7df870f28000 ---p 00000000 00:00 0 -7df870f28000-7df870f2c000 ---p 00000000 00:00 0 -7df870f2c000-7df871028000 rw-p 00000000 00:00 0 -7df871028000-7df87102d000 r--p 00000000 103:02 32271956 /usr/lib/jvm/java-21-openjdk/lib/libjsvml.so -7df87102d000-7df87106e000 r-xp 00005000 103:02 32271956 /usr/lib/jvm/java-21-openjdk/lib/libjsvml.so -7df87106e000-7df8710f7000 r--p 00046000 103:02 32271956 /usr/lib/jvm/java-21-openjdk/lib/libjsvml.so -7df8710f7000-7df8710f8000 r--p 000ce000 103:02 32271956 /usr/lib/jvm/java-21-openjdk/lib/libjsvml.so -7df8710f8000-7df8710f9000 rw-p 000cf000 103:02 32271956 /usr/lib/jvm/java-21-openjdk/lib/libjsvml.so -7df8710f9000-7df8710fa000 ---p 00000000 00:00 0 -7df8710fa000-7df8710fe000 ---p 00000000 00:00 0 -7df8710fe000-7df8711fa000 rw-p 00000000 00:00 0 -7df8711fa000-7df8711fb000 ---p 00000000 00:00 0 -7df8711fb000-7df8711ff000 ---p 00000000 00:00 0 -7df8711ff000-7df8712fb000 rw-p 00000000 00:00 0 -7df8712fb000-7df8712fc000 ---p 00000000 00:00 0 -7df8712fc000-7df871300000 ---p 00000000 00:00 0 -7df871300000-7df8713fc000 rw-p 00000000 00:00 0 -7df8713fc000-7df8713fd000 ---p 00000000 00:00 0 -7df8713fd000-7df871401000 ---p 00000000 00:00 0 -7df871401000-7df8714fd000 rw-p 00000000 00:00 0 -7df8714fd000-7df8714fe000 ---p 00000000 00:00 0 -7df8714fe000-7df871502000 ---p 00000000 00:00 0 -7df871502000-7df8715fe000 rw-p 00000000 00:00 0 -7df8715fe000-7df8715ff000 ---p 00000000 00:00 0 -7df8715ff000-7df871603000 ---p 00000000 00:00 0 -7df871603000-7df8716ff000 rw-p 00000000 00:00 0 -7df8716ff000-7df871700000 ---p 00000000 00:00 0 -7df871700000-7df871704000 ---p 00000000 00:00 0 -7df871704000-7df871800000 rw-p 00000000 00:00 0 -7df871800000-7df871c33000 r--p 00000000 103:02 30956149 /usr/lib/locale/locale-archive -7df871c33000-7df871c34000 rw-s 10a8d5000 00:10 2097 anon_inode:i915.gem -7df871c34000-7df871c36000 r--p 00000000 103:02 30971378 /usr/lib/libXfixes.so.3.1.0 -7df871c36000-7df871c39000 r-xp 00002000 103:02 30971378 /usr/lib/libXfixes.so.3.1.0 -7df871c39000-7df871c3a000 r--p 00005000 103:02 30971378 /usr/lib/libXfixes.so.3.1.0 -7df871c3a000-7df871c3b000 r--p 00005000 103:02 30971378 /usr/lib/libXfixes.so.3.1.0 -7df871c3b000-7df871c3c000 rw-p 00006000 103:02 30971378 /usr/lib/libXfixes.so.3.1.0 -7df871c3c000-7df871c3e000 r--p 00000000 103:02 30978836 /usr/lib/libXrandr.so.2.2.0 -7df871c3e000-7df871c45000 r-xp 00002000 103:02 30978836 /usr/lib/libXrandr.so.2.2.0 -7df871c45000-7df871c47000 r--p 00009000 103:02 30978836 /usr/lib/libXrandr.so.2.2.0 -7df871c47000-7df871c48000 r--p 0000a000 103:02 30978836 /usr/lib/libXrandr.so.2.2.0 -7df871c48000-7df871c49000 rw-p 0000b000 103:02 30978836 /usr/lib/libXrandr.so.2.2.0 -7df871c49000-7df871c4c000 r--p 00000000 103:02 30972246 /usr/lib/libXi.so.6.1.0 -7df871c4c000-7df871c58000 r-xp 00003000 103:02 30972246 /usr/lib/libXi.so.6.1.0 -7df871c58000-7df871c5a000 r--p 0000f000 103:02 30972246 /usr/lib/libXi.so.6.1.0 -7df871c5a000-7df871c5b000 r--p 00011000 103:02 30972246 /usr/lib/libXi.so.6.1.0 -7df871c5b000-7df871c5c000 rw-p 00012000 103:02 30972246 /usr/lib/libXi.so.6.1.0 -7df871c5c000-7df871c68000 r--p 00000000 103:02 30968089 /usr/lib/libxcb.so.1.1.0 -7df871c68000-7df871c7c000 r-xp 0000c000 103:02 30968089 /usr/lib/libxcb.so.1.1.0 -7df871c7c000-7df871c85000 r--p 00020000 103:02 30968089 /usr/lib/libxcb.so.1.1.0 -7df871c85000-7df871c86000 r--p 00028000 103:02 30968089 /usr/lib/libxcb.so.1.1.0 -7df871c86000-7df871c87000 rw-p 00029000 103:02 30968089 /usr/lib/libxcb.so.1.1.0 -7df871c87000-7df871cb0000 r--p 00000000 00:22 552 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl.so -7df871cb0000-7df871ce2000 r-xp 00029000 00:22 552 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl.so -7df871ce2000-7df871cfb000 r--p 0005b000 00:22 552 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl.so -7df871cfb000-7df871cfc000 r--p 00073000 00:22 552 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl.so -7df871cfc000-7df871cfd000 rw-p 00074000 00:22 552 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl.so -7df871cfd000-7df871cfe000 ---p 00000000 00:00 0 -7df871cfe000-7df871dfe000 rw-p 00000000 00:00 0 -7df871dfe000-7df871dff000 ---p 00000000 00:00 0 -7df871dff000-7df871eff000 rw-p 00000000 00:00 0 -7df871eff000-7df871f00000 ---p 00000000 00:00 0 -7df871f00000-7df872000000 rw-p 00000000 00:00 0 -7df872000000-7df874021000 rw-p 00000000 00:00 0 -7df874021000-7df878000000 ---p 00000000 00:00 0 -7df878000000-7df878001000 rw-s 106435000 00:10 2097 anon_inode:i915.gem -7df878001000-7df878002000 r--p 00000000 103:02 30970396 /usr/lib/libX11-xcb.so.1.0.0 -7df878002000-7df878003000 r-xp 00001000 103:02 30970396 /usr/lib/libX11-xcb.so.1.0.0 -7df878003000-7df878004000 r--p 00002000 103:02 30970396 /usr/lib/libX11-xcb.so.1.0.0 -7df878004000-7df878005000 r--p 00002000 103:02 30970396 /usr/lib/libX11-xcb.so.1.0.0 -7df878005000-7df878006000 rw-p 00003000 103:02 30970396 /usr/lib/libX11-xcb.so.1.0.0 -7df878006000-7df878007000 ---p 00000000 00:00 0 -7df878007000-7df878107000 rw-p 00000000 00:00 0 -7df878107000-7df878a90000 rw-p 00000000 00:00 0 -7df878a90000-7df879020000 ---p 00000000 00:00 0 -7df879020000-7df879040000 rw-p 00000000 00:00 0 -7df879040000-7df880600000 ---p 00000000 00:00 0 -7df880600000-7df880d70000 rwxp 00000000 00:00 0 -7df880d70000-7df887a5f000 ---p 00000000 00:00 0 -7df887a5f000-7df887e6f000 rwxp 00000000 00:00 0 -7df887e6f000-7df8881a0000 ---p 00000000 00:00 0 -7df8881a0000-7df888410000 rwxp 00000000 00:00 0 -7df888410000-7df88f600000 ---p 00000000 00:00 0 -7df88f600000-7df897e0d000 r--s 00000000 103:02 32271982 /usr/lib/jvm/java-21-openjdk/lib/modules -7df897e0d000-7df897e0e000 rw-s 1068b8000 00:10 2097 anon_inode:i915.gem -7df897e0e000-7df897e12000 r--p 00000000 103:02 30971209 /usr/lib/libXext.so.6.4.0 -7df897e12000-7df897e1d000 r-xp 00004000 103:02 30971209 /usr/lib/libXext.so.6.4.0 -7df897e1d000-7df897e21000 r--p 0000f000 103:02 30971209 /usr/lib/libXext.so.6.4.0 -7df897e21000-7df897e22000 r--p 00012000 103:02 30971209 /usr/lib/libXext.so.6.4.0 -7df897e22000-7df897e23000 rw-p 00013000 103:02 30971209 /usr/lib/libXext.so.6.4.0 -7df897e23000-7df898577000 rw-p 00000000 00:00 0 -7df898577000-7df89c000000 ---p 00000000 00:00 0 -7df89c001000-7df89c002000 r--p 00000000 103:02 30996814 /usr/lib/libXinerama.so.1.0.0 -7df89c002000-7df89c003000 r-xp 00001000 103:02 30996814 /usr/lib/libXinerama.so.1.0.0 -7df89c003000-7df89c004000 r--p 00002000 103:02 30996814 /usr/lib/libXinerama.so.1.0.0 -7df89c004000-7df89c005000 r--p 00002000 103:02 30996814 /usr/lib/libXinerama.so.1.0.0 -7df89c005000-7df89c006000 rw-p 00003000 103:02 30996814 /usr/lib/libXinerama.so.1.0.0 -7df89c006000-7df89c007000 r--p 00000000 103:02 30971391 /usr/lib/libXxf86vm.so.1.0.0 -7df89c007000-7df89c00a000 r-xp 00001000 103:02 30971391 /usr/lib/libXxf86vm.so.1.0.0 -7df89c00a000-7df89c00b000 r--p 00004000 103:02 30971391 /usr/lib/libXxf86vm.so.1.0.0 -7df89c00b000-7df89c00c000 r--p 00004000 103:02 30971391 /usr/lib/libXxf86vm.so.1.0.0 -7df89c00c000-7df89c00d000 rw-p 00005000 103:02 30971391 /usr/lib/libXxf86vm.so.1.0.0 -7df89c00d000-7df89c00f000 r--p 00000000 103:02 30967963 /usr/lib/libXdmcp.so.6.0.0 -7df89c00f000-7df89c011000 r-xp 00002000 103:02 30967963 /usr/lib/libXdmcp.so.6.0.0 -7df89c011000-7df89c013000 r--p 00004000 103:02 30967963 /usr/lib/libXdmcp.so.6.0.0 -7df89c013000-7df89c014000 r--p 00005000 103:02 30967963 /usr/lib/libXdmcp.so.6.0.0 -7df89c014000-7df89c015000 rw-p 00006000 103:02 30967963 /usr/lib/libXdmcp.so.6.0.0 -7df89c015000-7df89c016000 r--p 00000000 103:02 30967967 /usr/lib/libXau.so.6.0.0 -7df89c016000-7df89c017000 r-xp 00001000 103:02 30967967 /usr/lib/libXau.so.6.0.0 -7df89c017000-7df89c018000 r--p 00002000 103:02 30967967 /usr/lib/libXau.so.6.0.0 -7df89c018000-7df89c019000 r--p 00002000 103:02 30967967 /usr/lib/libXau.so.6.0.0 -7df89c019000-7df89c01a000 rw-p 00003000 103:02 30967967 /usr/lib/libXau.so.6.0.0 -7df89c01a000-7df89c01b000 r--p 00000000 103:02 30936448 /usr/lib/librt.so.1 -7df89c01b000-7df89c01c000 r-xp 00001000 103:02 30936448 /usr/lib/librt.so.1 -7df89c01c000-7df89c01d000 r--p 00002000 103:02 30936448 /usr/lib/librt.so.1 -7df89c01d000-7df89c01e000 r--p 00002000 103:02 30936448 /usr/lib/librt.so.1 -7df89c01e000-7df89c01f000 rw-p 00003000 103:02 30936448 /usr/lib/librt.so.1 -7df89c01f000-7df89c524000 rw-p 00000000 00:00 0 -7df89c524000-7df89c525000 ---p 00000000 00:00 0 -7df89c525000-7df89c625000 rw-p 00000000 00:00 0 -7df89c625000-7df89c626000 ---p 00000000 00:00 0 -7df89c626000-7df89c726000 rw-p 00000000 00:00 0 -7df89c726000-7df89c727000 ---p 00000000 00:00 0 -7df89c727000-7df89c827000 rw-p 00000000 00:00 0 -7df89c827000-7df89c933000 rw-p 00000000 00:00 0 -7df89c933000-7df89c9e5000 ---p 00000000 00:00 0 -7df89c9e5000-7df89c9e9000 rw-p 00000000 00:00 0 -7df89c9e9000-7df89d8a1000 ---p 00000000 00:00 0 -7df89d8a1000-7df89d8b1000 rw-p 00000000 00:00 0 -7df89d8b1000-7df89d963000 ---p 00000000 00:00 0 -7df89d963000-7df89d967000 rw-p 00000000 00:00 0 -7df89d967000-7df89e81f000 ---p 00000000 00:00 0 -7df89e81f000-7df89f733000 rw-p 00000000 00:00 0 -7df89f733000-7df89f817000 ---p 00000000 00:00 0 -7df89f817000-7df89f826000 rw-p 00000000 00:00 0 -7df89f826000-7df89f900000 ---p 00000000 00:00 0 -7df89f900000-7df89f904000 ---p 00000000 00:00 0 -7df89f904000-7df89fa00000 rw-p 00000000 00:00 0 -7df89fa00000-7df89fa97000 r--p 00000000 103:02 30935565 /usr/lib/libstdc++.so.6.0.33 -7df89fa97000-7df89fbe4000 r-xp 00097000 103:02 30935565 /usr/lib/libstdc++.so.6.0.33 -7df89fbe4000-7df89fc74000 r--p 001e4000 103:02 30935565 /usr/lib/libstdc++.so.6.0.33 -7df89fc74000-7df89fc81000 r--p 00274000 103:02 30935565 /usr/lib/libstdc++.so.6.0.33 -7df89fc81000-7df89fc82000 rw-p 00281000 103:02 30935565 /usr/lib/libstdc++.so.6.0.33 -7df89fc82000-7df89fc86000 rw-p 00000000 00:00 0 -7df89fc88000-7df89fc89000 r--p 00000000 103:02 30936443 /usr/lib/libpthread.so.0 -7df89fc89000-7df89fc8a000 r-xp 00001000 103:02 30936443 /usr/lib/libpthread.so.0 -7df89fc8a000-7df89fc8b000 r--p 00002000 103:02 30936443 /usr/lib/libpthread.so.0 -7df89fc8b000-7df89fc8c000 r--p 00002000 103:02 30936443 /usr/lib/libpthread.so.0 -7df89fc8c000-7df89fc8d000 rw-p 00003000 103:02 30936443 /usr/lib/libpthread.so.0 -7df89fc8e000-7df89fc8f000 r--p 00000000 103:02 31488211 /usr/lib/spa-0.2/support/libspa-journal.so -7df89fc8f000-7df89fc91000 r-xp 00001000 103:02 31488211 /usr/lib/spa-0.2/support/libspa-journal.so -7df89fc91000-7df89fc92000 r--p 00003000 103:02 31488211 /usr/lib/spa-0.2/support/libspa-journal.so -7df89fc92000-7df89fc93000 r--p 00003000 103:02 31488211 /usr/lib/spa-0.2/support/libspa-journal.so -7df89fc93000-7df89fc94000 rw-p 00004000 103:02 31488211 /usr/lib/spa-0.2/support/libspa-journal.so -7df89fc96000-7df89fc97000 rw-s 10e1dd000 00:10 2097 anon_inode:i915.gem -7df89fc97000-7df89fc98000 rw-s 10558b000 00:10 2097 anon_inode:i915.gem -7df89fc98000-7df89fcb8000 rw-s 108615000 00:10 2097 anon_inode:i915.gem -7df89fcb8000-7df89fcb9000 rw-s 10558a000 00:10 2097 anon_inode:i915.gem -7df89fcb9000-7df89fcc9000 rw-s 10df12000 00:10 2097 anon_inode:i915.gem -7df89fcc9000-7df89fcd0000 r--s 00000000 103:02 30956479 /usr/lib/gconv/gconv-modules.cache -7df89fcd0000-7df89fd11000 rw-p 00000000 00:00 0 -7df89fd11000-7df89fd1f000 r--p 00000000 103:02 30936411 /usr/lib/libm.so.6 -7df89fd1f000-7df89fda2000 r-xp 0000e000 103:02 30936411 /usr/lib/libm.so.6 -7df89fda2000-7df89fdfe000 r--p 00091000 103:02 30936411 /usr/lib/libm.so.6 -7df89fdfe000-7df89fdff000 r--p 000ec000 103:02 30936411 /usr/lib/libm.so.6 -7df89fdff000-7df89fe00000 rw-p 000ed000 103:02 30936411 /usr/lib/libm.so.6 -7df89fe00000-7df89fe0e000 r--p 00000000 103:02 32272110 /usr/lib/jvm/java-21-openjdk/lib/server/libjvm.so -7df89fe0e000-7df8a0da0000 r-xp 0000e000 103:02 32272110 /usr/lib/jvm/java-21-openjdk/lib/server/libjvm.so -7df8a0da0000-7df8a0f8f000 r--p 00fa0000 103:02 32272110 /usr/lib/jvm/java-21-openjdk/lib/server/libjvm.so -7df8a0f8f000-7df8a1060000 r--p 0118e000 103:02 32272110 /usr/lib/jvm/java-21-openjdk/lib/server/libjvm.so -7df8a1060000-7df8a108a000 rw-p 0125f000 103:02 32272110 /usr/lib/jvm/java-21-openjdk/lib/server/libjvm.so -7df8a108a000-7df8a10f0000 rw-p 00000000 00:00 0 -7df8a10f0000-7df8a10f1000 r--p 00000000 103:02 30936400 /usr/lib/libdl.so.2 -7df8a10f1000-7df8a10f2000 r-xp 00001000 103:02 30936400 /usr/lib/libdl.so.2 -7df8a10f2000-7df8a10f3000 r--p 00002000 103:02 30936400 /usr/lib/libdl.so.2 -7df8a10f3000-7df8a10f4000 r--p 00002000 103:02 30936400 /usr/lib/libdl.so.2 -7df8a10f4000-7df8a10f5000 rw-p 00003000 103:02 30936400 /usr/lib/libdl.so.2 -7df8a10f5000-7df8a10f7000 r--p 00000000 103:02 32271980 /usr/lib/jvm/java-21-openjdk/lib/libzip.so -7df8a10f7000-7df8a10fb000 r-xp 00002000 103:02 32271980 /usr/lib/jvm/java-21-openjdk/lib/libzip.so -7df8a10fb000-7df8a10fd000 r--p 00006000 103:02 32271980 /usr/lib/jvm/java-21-openjdk/lib/libzip.so -7df8a10fd000-7df8a10fe000 r--p 00007000 103:02 32271980 /usr/lib/jvm/java-21-openjdk/lib/libzip.so -7df8a10fe000-7df8a10ff000 rw-p 00008000 103:02 32271980 /usr/lib/jvm/java-21-openjdk/lib/libzip.so -7df8a10ff000-7df8a1102000 r--p 00000000 103:02 32271967 /usr/lib/jvm/java-21-openjdk/lib/libnet.so -7df8a1102000-7df8a1109000 r-xp 00003000 103:02 32271967 /usr/lib/jvm/java-21-openjdk/lib/libnet.so -7df8a1109000-7df8a110b000 r--p 0000a000 103:02 32271967 /usr/lib/jvm/java-21-openjdk/lib/libnet.so -7df8a110b000-7df8a110c000 r--p 0000b000 103:02 32271967 /usr/lib/jvm/java-21-openjdk/lib/libnet.so -7df8a110c000-7df8a110d000 rw-p 0000c000 103:02 32271967 /usr/lib/jvm/java-21-openjdk/lib/libnet.so -7df8a110d000-7df8a1114000 r--p 00000000 103:02 32271968 /usr/lib/jvm/java-21-openjdk/lib/libnio.so -7df8a1114000-7df8a111d000 r-xp 00007000 103:02 32271968 /usr/lib/jvm/java-21-openjdk/lib/libnio.so -7df8a111d000-7df8a1122000 r--p 00010000 103:02 32271968 /usr/lib/jvm/java-21-openjdk/lib/libnio.so -7df8a1122000-7df8a1123000 r--p 00014000 103:02 32271968 /usr/lib/jvm/java-21-openjdk/lib/libnio.so -7df8a1123000-7df8a1124000 rw-p 00015000 103:02 32271968 /usr/lib/jvm/java-21-openjdk/lib/libnio.so -7df8a1124000-7df8a11a0000 rw-p 00000000 00:00 0 -7df8a11a0000-7df8a11a4000 r--p 00000000 103:02 30935532 /usr/lib/libgcc_s.so.1 -7df8a11a4000-7df8a11c8000 r-xp 00004000 103:02 30935532 /usr/lib/libgcc_s.so.1 -7df8a11c8000-7df8a11cc000 r--p 00028000 103:02 30935532 /usr/lib/libgcc_s.so.1 -7df8a11cc000-7df8a11cd000 r--p 0002b000 103:02 30935532 /usr/lib/libgcc_s.so.1 -7df8a11cd000-7df8a11ce000 rw-p 0002c000 103:02 30935532 /usr/lib/libgcc_s.so.1 -7df8a11ce000-7df8a11d1000 rw-p 00000000 00:00 0 -7df8a11d1000-7df8a11d4000 r--p 00000000 103:02 30948442 /usr/lib/libz.so.1.3.1 -7df8a11d4000-7df8a11e2000 r-xp 00003000 103:02 30948442 /usr/lib/libz.so.1.3.1 -7df8a11e2000-7df8a11e8000 r--p 00011000 103:02 30948442 /usr/lib/libz.so.1.3.1 -7df8a11e8000-7df8a11e9000 r--p 00017000 103:02 30948442 /usr/lib/libz.so.1.3.1 -7df8a11e9000-7df8a11ea000 rw-p 00018000 103:02 30948442 /usr/lib/libz.so.1.3.1 -7df8a11ea000-7df8a120e000 r--p 00000000 103:02 30936391 /usr/lib/libc.so.6 -7df8a120e000-7df8a137f000 r-xp 00024000 103:02 30936391 /usr/lib/libc.so.6 -7df8a137f000-7df8a13cd000 r--p 00195000 103:02 30936391 /usr/lib/libc.so.6 -7df8a13cd000-7df8a13d1000 r--p 001e3000 103:02 30936391 /usr/lib/libc.so.6 -7df8a13d1000-7df8a13d3000 rw-p 001e7000 103:02 30936391 /usr/lib/libc.so.6 -7df8a13d3000-7df8a13db000 rw-p 00000000 00:00 0 -7df8a13db000-7df8a13dc000 rw-s 105589000 00:10 2097 anon_inode:i915.gem -7df8a13dc000-7df8a13dd000 rw-p 00000000 00:00 0 -7df8a13dd000-7df8a13de000 r-xp 00059000 00:22 552 /tmp/lwjgl_koppe/3.3.3+5/x64/liblwjgl.so -7df8a13de000-7df8a13e8000 rw-p 00000000 00:00 0 -7df8a13e8000-7df8a13ee000 ---p 00000000 00:00 0 -7df8a13ee000-7df8a13f8000 r--p 00000000 103:02 32271945 /usr/lib/jvm/java-21-openjdk/lib/libjava.so -7df8a13f8000-7df8a1405000 r-xp 0000a000 103:02 32271945 /usr/lib/jvm/java-21-openjdk/lib/libjava.so -7df8a1405000-7df8a140a000 r--p 00017000 103:02 32271945 /usr/lib/jvm/java-21-openjdk/lib/libjava.so -7df8a140a000-7df8a140b000 r--p 0001b000 103:02 32271945 /usr/lib/jvm/java-21-openjdk/lib/libjava.so -7df8a140b000-7df8a140c000 rw-p 0001c000 103:02 32271945 /usr/lib/jvm/java-21-openjdk/lib/libjava.so -7df8a140c000-7df8a140d000 rw-p 00000000 00:00 0 -7df8a140d000-7df8a1415000 rw-s 00000000 00:22 811 /tmp/hsperfdata_koppe/24033 -7df8a1415000-7df8a1416000 ---p 00000000 00:00 0 -7df8a1416000-7df8a1417000 r--p 00000000 00:00 0 -7df8a1417000-7df8a1418000 ---p 00000000 00:00 0 -7df8a1418000-7df8a1419000 r--p 00000000 103:02 32271950 /usr/lib/jvm/java-21-openjdk/lib/libjimage.so -7df8a1419000-7df8a141b000 r-xp 00001000 103:02 32271950 /usr/lib/jvm/java-21-openjdk/lib/libjimage.so -7df8a141b000-7df8a141c000 r--p 00003000 103:02 32271950 /usr/lib/jvm/java-21-openjdk/lib/libjimage.so -7df8a141c000-7df8a141d000 r--p 00003000 103:02 32271950 /usr/lib/jvm/java-21-openjdk/lib/libjimage.so -7df8a141d000-7df8a141e000 rw-p 00004000 103:02 32271950 /usr/lib/jvm/java-21-openjdk/lib/libjimage.so -7df8a141e000-7df8a1420000 r--p 00000000 103:02 32271952 /usr/lib/jvm/java-21-openjdk/lib/libjli.so -7df8a1420000-7df8a142a000 r-xp 00002000 103:02 32271952 /usr/lib/jvm/java-21-openjdk/lib/libjli.so -7df8a142a000-7df8a142d000 r--p 0000c000 103:02 32271952 /usr/lib/jvm/java-21-openjdk/lib/libjli.so -7df8a142d000-7df8a142e000 r--p 0000e000 103:02 32271952 /usr/lib/jvm/java-21-openjdk/lib/libjli.so -7df8a142e000-7df8a142f000 rw-p 0000f000 103:02 32271952 /usr/lib/jvm/java-21-openjdk/lib/libjli.so -7df8a142f000-7df8a1431000 rw-p 00000000 00:00 0 -7df8a1431000-7df8a1435000 r--p 00000000 00:00 0 [vvar] -7df8a1435000-7df8a1437000 r-xp 00000000 00:00 0 [vdso] -7df8a1437000-7df8a1438000 r--p 00000000 103:02 30936371 /usr/lib/ld-linux-x86-64.so.2 -7df8a1438000-7df8a1461000 r-xp 00001000 103:02 30936371 /usr/lib/ld-linux-x86-64.so.2 -7df8a1461000-7df8a146b000 r--p 0002a000 103:02 30936371 /usr/lib/ld-linux-x86-64.so.2 -7df8a146b000-7df8a146d000 r--p 00034000 103:02 30936371 /usr/lib/ld-linux-x86-64.so.2 -7df8a146d000-7df8a146f000 rw-p 00036000 103:02 30936371 /usr/lib/ld-linux-x86-64.so.2 -7ffec63a3000-7ffec63c7000 rw-p 00000000 00:00 0 [stack] -ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall] -Total number of mappings: 902 - - -VM Arguments: -jvm_args: -Djava.util.logging.config.file=logging.properties -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea -java_command: pp.mdga.client.MdgaApp -java_class_path (initial): /home/koppe/Workspace/gruppe01/Projekte/mdga/client/build/classes/java/main:/home/koppe/Workspace/gruppe01/Projekte/mdga/client/build/resources/main:/home/koppe/Workspace/gruppe01/Projekte/jme-common/build/libs/jme-common.jar:/home/koppe/Workspace/gruppe01/Projekte/mdga/model/build/libs/model.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-lwjgl3/3.7.0-stable/32854ef2092f96c6d5f79bdb97952ead4a545d33/jme3-lwjgl3-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-lwjgl/3.7.0-stable/2f587fb3ff6666621dc568b269b6d32d050b5c4e/jme3-lwjgl-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-desktop/3.7.0-stable/b7f78acb62320b4da5dfed82bfde91f538c21ef0/jme3-desktop-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-effects/3.7.0-stable/2b984cf9f60f8f9b588641cae4f13892afd30bcc/jme3-effects-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-awt-dialogs/3.7.0-stable/a77c99e8aded4a3c3ede229cbd9c7806dfa501e0/jme3-awt-dialogs-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-plugins/3.7.0-stable/bcd9b6f036f9d449dd86ef4dbe8dac4c0d3cb6bc/jme3-plugins-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-jogg/3.7.0-stable/3f3a575315b5d5e2cc34c320ab376995e05bbb0f/jme3-jogg-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/com.simsilica/lemur/1.16.0/8e4af305c8c00dde11db8d76be8debd5ee751c09/lemur-1.16.0.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-networking/3.7.0-stable/a4ba663df4480c3b8075595ef8b89530a673e111/jme3-networking-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-core/3.7.0-stable/227022186bdeac8688f3f1f75ce64a9d3c7ee6ec/jme3-core-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-testdata/3.7.0-stable/48de1c8b8cbb541f387396bd2a56bbafe2d78570/jme3-testdata-3.7.0-stable.jar:/home/koppe/Workspace/gruppe01/Projekte/common/build/libs/common.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.apache.groovy/groovy/4.0.22/a04df669ad2778678072315bc92f10f03362e7d7/groovy-4.0.22.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.apache.groovy/groovy-jsr223/4.0.22/f34aaaf61eef10065ff1a8f338de7a7c6b5cdfcc/groovy-jsr223-4.0.22.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-nop/2.0.13/f46230afff57b938ff9e7ac315270a83fdf21e87/slf4j-nop-2.0.13.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-plugins-json-gson/3.7.0-stable/8ccb789889d18c2df1856f2f2940d1a92982c2d5/jme3-plugins-json-gson-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.11.0/527175ca6d81050b53bdd4c457a6d6e017626b0e/gson-2.11.0.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjglx/lwjgl3-awt/0.1.8/245db5fbcece710ebceb0a0f200bf11333504e4/lwjgl3-awt-0.1.8.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.3/efa1eb78c5ccd840e9f329717109b5e892d72f8e/lwjgl-glfw-3.3.3.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.3/e449e28b4891fc423c54c85fbc5bb0b9efece67a/lwjgl-glfw-3.3.3-natives-windows.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.3/32334f3fd5270a59bad9939a93115acb6de36dcf/lwjgl-glfw-3.3.3-natives-windows-x86.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.3/a03684c5e4b1b1dbbe0d29dbbdc27b985b6840f2/lwjgl-glfw-3.3.3-natives-linux.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.3/d9af485c32545b37dd5359b163161d42d7534dcf/lwjgl-glfw-3.3.3-natives-linux-arm32.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.3/492a0f11f85b85899a6568f07511160c1b87cd38/lwjgl-glfw-3.3.3-natives-linux-arm64.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.3/a1bf400f6bc64e6195596cb1430dafda46090751/lwjgl-glfw-3.3.3-natives-macos.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-glfw/3.3.3/ee8cc78d0a4a5b3b4600fade6d927c9fc320c858/lwjgl-glfw-3.3.3-natives-macos-arm64.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jawt/3.3.3/15479071013804d88cc810856fcc2548b457376c/lwjgl-jawt-3.3.3.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.3/b543467b7ff3c6920539a88ee602d34098628be5/lwjgl-jemalloc-3.3.3.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.3/426222fc027602a5f21b9c0fe79cde6a4c7a011f/lwjgl-jemalloc-3.3.3-natives-windows.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.3/f6063b6e0f23be483c5c88d84ce51b39dc69126c/lwjgl-jemalloc-3.3.3-natives-windows-x86.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.3/4f86728bf449b1dd61251c4e0ac01df1389cb51e/lwjgl-jemalloc-3.3.3-natives-linux.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.3/109b6931880d02d4e65ced38928a16e41d19873e/lwjgl-jemalloc-3.3.3-natives-linux-arm32.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.3/eff8b86798191192fe2cba2dc2776109f30c239d/lwjgl-jemalloc-3.3.3-natives-linux-arm64.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.3/2906637657a57579847238c9c72d2c4bde7083f8/lwjgl-jemalloc-3.3.3-natives-macos.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-jemalloc/3.3.3/e9412c3ff8cb3a3bad1d3f52909ad74d8a5bdad1/lwjgl-jemalloc-3.3.3-natives-macos-arm64.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.3/daada81ceb5fc0c291fbfdd4433cb8d9423577f2/lwjgl-openal-3.3.3.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.3/cf83862ae95d98496b26915024c7e666d8ab1c8f/lwjgl-openal-3.3.3-natives-windows.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.3/87b8d5050e3adb46bb58fe1cb2669a4a48fce10d/lwjgl-openal-3.3.3-natives-windows-x86.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.3/3037360cc4595079bea240af250b6d1a527e0905/lwjgl-openal-3.3.3-natives-linux.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.3/e1702aa09d20359d6cf5cb2999fa7685a785eca7/lwjgl-openal-3.3.3-natives-linux-arm32.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.3/ad8f302118a65bb8d615f8a2a680db58fb8f835e/lwjgl-openal-3.3.3-natives-linux-arm64.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.3/8df8338bfa77f2ebabef4e58964bd04d24805cbf/lwjgl-openal-3.3.3-natives-macos.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-openal/3.3.3/c78b078de2fb52f45aa55d04db889a560f3544f/lwjgl-openal-3.3.3-natives-macos-arm64.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opencl/3.3.3/fdf4a5cce0b7499914ac96a87d75fa895a4e0699/lwjgl-opencl-3.3.3.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.3/2f6b0147078396a58979125a4c947664e98293a/lwjgl-opengl-3.3.3.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.3/e6c1eec8be8a71951b830a4d69efc01c6531900c/lwjgl-opengl-3.3.3-natives-windows.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.3/d32d833dcaa2f355a886eaf21f0408b5f03241d/lwjgl-opengl-3.3.3-natives-windows-x86.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.3/62c70a4b00ca5391882b0f4b787c1588d24f1c86/lwjgl-opengl-3.3.3-natives-linux.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.3/dbba17fc5ac0985d14a57c11f9537617d67b9952/lwjgl-opengl-3.3.3-natives-linux-arm32.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.3/2096f6b94b2d68745d858fbfe53aacf5f0c8074c/lwjgl-opengl-3.3.3-natives-linux-arm64.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.3/1bd45997551ae8a28469f3a2b678f4b7289e12c0/lwjgl-opengl-3.3.3-natives-macos.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl-opengl/3.3.3/d213ddef27637b1af87961ffa94d6b27036becc8/lwjgl-opengl-3.3.3-natives-macos-arm64.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.3/29589b5f87ed335a6c7e7ee6a5775f81f97ecb84/lwjgl-3.3.3.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.3/a5ed18a2b82fc91b81f40d717cb1f64c9dcb0540/lwjgl-3.3.3-natives-windows.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.3/9e670718e050aeaeea0c2d5b907cffb142f2e58f/lwjgl-3.3.3-natives-windows-x86.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.3/1713758e3660ba66e1e954396fd18126038b33c0/lwjgl-3.3.3-natives-linux.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.3/2075c51a80f0ef0f22ba616ba54007ac2b0debd4/lwjgl-3.3.3-natives-linux-arm32.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.3/f35d8b6ffe1ac1e3a5eb1d4e33de80f044ad5fd8/lwjgl-3.3.3-natives-linux-arm64.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.3/33a6efa288390490ce6eb6c3df47ac21ecf648cf/lwjgl-3.3.3-natives-macos.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.lwjgl/lwjgl/3.3.3/226246e75f6bd8d4e1895bdce8638ef87808d114/lwjgl-3.3.3-natives-macos-arm64.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/lwjgl/2.9.5/e9336e9c89dcd951e926348350dda38e537eaddc/lwjgl-2.9.5.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput/2.0.9/5c05470d6ede64e77b1f24a052ea2650aecf4036/jinput-2.0.9.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput/2.0.9/e8fdb885382ae421744a53b30f50b4afa5c83166/jinput-2.0.9-natives-all.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/jme3-plugins-json/3.7.0-stable/dbfbabc272ec088f63b4c10b92d2428b3ce5af0b/jme3-plugins-json-3.7.0-stable.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/com.github.stephengold/j-ogg-vorbis/1.0.4/e0f9ca17c456601488595f170bbf83f9a7005f29/j-ogg-vorbis-1.0.4.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/19.0/6ce200f6b23222af3d8abb6b6459e6c44f4bb0e9/guava-19.0.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/2.0.13/80229737f704b121a318bba5d5deacbcf395bc77/slf4j-api-2.0.13.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.27.0/91b2c29d8a6148b5e2e4930f070d4840e2e48e34/error_prone_annotations-2.27.0.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/lwjgl-platform/2.9.5/412527b9dc3d1e7f9330742decd04f0e65c48fd9/lwjgl-platform-2.9.5-natives-windows.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/lwjgl-platform/2.9.5/e6beda4e352592b62d418496a4ff490e6fa82fcf/lwjgl-platform-2.9.5-natives-linux.jar:/home/koppe/.gradle/caches/modules-2/files-2.1/org.jmonkeyengine/lwjgl-platform/2.9.5/76b774cc6559412294cccda57140fd250d6b9311/lwjgl-platform-2.9.5-natives-osx.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 12 {product} {ergonomic} - uint ConcGCThreads = 4 {product} {ergonomic} - uint G1ConcRefinementThreads = 15 {product} {ergonomic} - size_t G1HeapRegionSize = 4194304 {product} {ergonomic} - uintx GCDrainStackTargetSize = 64 {product} {ergonomic} - size_t InitialHeapSize = 520093696 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 8317304832 {product} {ergonomic} - size_t MaxNewSize = 4987027456 {product} {ergonomic} - size_t MinHeapDeltaBytes = 4194304 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 8317304832 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Environment Variables: -PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl -SHELL=/usr/bin/bash -DISPLAY=:0 -LANG=en_US.UTF-8 -LC_TIME=de_DE.UTF-8 - -Active Locale: -LC_ALL=LC_CTYPE=en_US.UTF-8;LC_NUMERIC=en_US.UTF-8;LC_TIME=de_DE.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=de_DE.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=en_US.UTF-8;LC_ADDRESS=en_US.UTF-8;LC_TELEPHONE=en_US.UTF-8;LC_MEASUREMENT=de_DE.UTF-8;LC_IDENTIFICATION=en_US.UTF-8 -LC_COLLATE=en_US.UTF-8 -LC_CTYPE=en_US.UTF-8 -LC_MESSAGES=en_US.UTF-8 -LC_MONETARY=de_DE.UTF-8 -LC_NUMERIC=en_US.UTF-8 -LC_TIME=de_DE.UTF-8 - -Signal Handlers: - SIGSEGV: 0x00007df8a0a5f8d0 in libjvm.so+12974288, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGBUS: 0x00007df8a0a5f8d0 in libjvm.so+12974288, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGFPE: 0x00007df8a0a5f8d0 in libjvm.so+12974288, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGPIPE: 0x00007df8a091df80 in libjvm.so+11657088, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGXFSZ: 0x00007df8a091df80 in libjvm.so+11657088, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGILL: 0x00007df8a0a5f8d0 in libjvm.so+12974288, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked - SIGUSR2: 0x00007df8a092bad0 in libjvm.so+11713232, mask=00000000000000000000000000000000, flags=SA_RESTART|SA_SIGINFO, blocked - SIGHUP: 0x00007df8a0916540 in libjvm.so+11625792, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGINT: 0x00007df8a0916540 in libjvm.so+11625792, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTERM: 0x00007df8a0916540 in libjvm.so+11625792, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGQUIT: 0x00007df8a0916540 in libjvm.so+11625792, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, blocked - SIGTRAP: 0x00007df8a0a5f8d0 in libjvm.so+12974288, mask=11100100010111111101111111111110, flags=SA_RESTART|SA_SIGINFO, unblocked - - -Periodic native trim disabled - ---------------- S Y S T E M --------------- - -OS: -DISTRIB_ID="Arch" -DISTRIB_RELEASE="rolling" -DISTRIB_DESCRIPTION="Arch Linux" -uname: Linux 6.12.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 22 Nov 2024 16:04:27 +0000 x86_64 -OS uptime: 0 days 2:49 hours -libc: glibc 2.40 NPTL 2.40 -rlimit (soft/hard): STACK 8192k/infinity , CORE infinity/infinity , NPROC 125807/125807 , NOFILE 524288/524288 , AS infinity/infinity , CPU infinity/infinity , DATA infinity/infinity , FSIZE infinity/infinity , MEMLOCK 8192k/8192k -load average: 2.16 2.20 1.88 - -/proc/meminfo: -MemTotal: 32487148 kB -MemFree: 17487956 kB -MemAvailable: 21689960 kB -Buffers: 185728 kB -Cached: 6847700 kB -SwapCached: 0 kB -Active: 8649604 kB -Inactive: 2724036 kB -Active(anon): 6872080 kB -Inactive(anon): 0 kB -Active(file): 1777524 kB -Inactive(file): 2724036 kB -Unevictable: 2485724 kB -Mlocked: 22216 kB -SwapTotal: 0 kB -SwapFree: 0 kB -Zswap: 0 kB -Zswapped: 0 kB -Dirty: 368 kB -Writeback: 0 kB -AnonPages: 6795264 kB -Mapped: 1149796 kB -Shmem: 2525984 kB -KReclaimable: 138844 kB -Slab: 299616 kB -SReclaimable: 138844 kB -SUnreclaim: 160772 kB -KernelStack: 23280 kB -PageTables: 48456 kB -SecPageTables: 2080 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -WritebackTmp: 0 kB -CommitLimit: 16243572 kB -Committed_AS: 15958592 kB -VmallocTotal: 34359738367 kB -VmallocUsed: 148372 kB -VmallocChunk: 0 kB -Percpu: 13040 kB -HardwareCorrupted: 0 kB -AnonHugePages: 4638720 kB -ShmemHugePages: 2347008 kB -ShmemPmdMapped: 0 kB -FileHugePages: 1042432 kB -FilePmdMapped: 329728 kB -CmaTotal: 0 kB -CmaFree: 0 kB -Unaccepted: 0 kB -HugePages_Total: 0 -HugePages_Free: 0 -HugePages_Rsvd: 0 -HugePages_Surp: 0 -Hugepagesize: 2048 kB -Hugetlb: 0 kB -DirectMap4k: 719676 kB -DirectMap2M: 8341504 kB -DirectMap1G: 25165824 kB - -/sys/kernel/mm/transparent_hugepage/enabled: [always] madvise never -/sys/kernel/mm/transparent_hugepage/hpage_pmd_size: 2097152 -/sys/kernel/mm/transparent_hugepage/defrag (defrag/compaction efforts parameter): always defer defer+madvise [madvise] never - -Process Memory: -Virtual Size: 14733844K (peak: 14919248K) -Resident Set Size: 789580K (peak: 1193556K) (anon: 622176K, file: 164364K, shmem: 3040K) -Swapped out: 0K -C-Heap outstanding allocations: 61683K, retained: 57864K -glibc malloc tunables: (default) - -/proc/sys/kernel/threads-max (system-wide limit on the number of threads): 251615 -/proc/sys/vm/max_map_count (maximum number of memory map areas a process may have): 1048576 -/proc/sys/vm/swappiness (control to define how aggressively the kernel swaps out anonymous memory): 60 -/proc/sys/kernel/pid_max (system-wide limit on number of process identifiers): 4194304 - -container information not found. -Steal ticks since vm start: 0 -Steal ticks percentage since vm start: 0.000 - -CPU: total 20 (initial active 20) (20 cores per cpu, 1 threads per core) family 6 model 154 stepping 3 microcode 0x42c, cx8, cmov, fxsr, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, clwb, serialize, rdtscp, rdpid, fsrm, f16c, pku, ospke, cet_ibt, cet_ss -CPU Model and flags from /proc/cpuinfo: -model name : 12th Gen Intel(R) Core(TM) i7-12700H -flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities - -Online cpus: 0-19 -Offline cpus: -BIOS frequency limitation: -Frequency switch latency (ns): 0 -Available cpu frequencies: -Current governor: powersave -Core performance/turbo boost: - -Memory: 4k page, physical 32487148k(21689960k free), swap 0k(0k free) -Page Sizes: 4k - -vm_info: OpenJDK 64-Bit Server VM (21.0.5+11) for linux-amd64 JRE (21.0.5+11), built on 2024-10-16T10:19:33Z by "builduser" with gcc 14.2.1 20240910 - -END. diff --git a/Projekte/mdga/client/hs_err_pid54211.log b/Projekte/mdga/client/hs_err_pid54211.log deleted file mode 100644 index 9b6e3d33..00000000 --- a/Projekte/mdga/client/hs_err_pid54211.log +++ /dev/null @@ -1,21 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x000070ba272e8104, pid=54211, tid=54346 -# -# JRE version: OpenJDK Runtime Environment Temurin-20.0.2+9 (20.0.2+9) (build 20.0.2+9) -# Java VM: OpenJDK 64-Bit Server VM Temurin-20.0.2+9 (20.0.2+9, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) -# Problematic frame: -# V [libjvm.so+0xee8104] SystemDictionary::find_or_define_helper(Symbol*, Handle, InstanceKlass*, JavaThread*)+0x304 -# -# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/cedric/ProgProjekt/Gruppe-01/Projekte/mdga/client/core.54211) -# -# If you would like to submit a bug report, please visit: -# https://github.com/adoptium/adoptium-support/issues -# - ---------------- S U M M A R Y ------------ - -Command Line: -Ddebugger.agent.enable.coroutines=true -Djava.util.logging.config.file=logging.properties -Dkotlinx.coroutines.debug.enable.creation.stack.trace=false -Dkotlinx.coroutines.debug.enable.flows.stack.trace=true -Dkotlinx.coroutines.debug.enable.mutable.state.flows.stack.trace=true -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=127.0.0.1:40559 -javaagent:/usr/share/idea/plugins/java/lib/rt/debugger-agent.jar -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea pp.mdga.client.MdgaApp - -Host: AMD Ryzen 5 8640HS w/ Radeon 760M Graphics, 12 cores, 14G, \ No newline at end of file diff --git a/Projekte/mdga/client/hs_err_pid60653.log b/Projekte/mdga/client/hs_err_pid60653.log deleted file mode 100644 index 974a6ce1..00000000 --- a/Projekte/mdga/client/hs_err_pid60653.log +++ /dev/null @@ -1,171 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# SIGSEGV (0xb) at pc=0x00007fc14e0eef41, pid=60653, tid=60689 -# -# JRE version: OpenJDK Runtime Environment (21.0.5+11) (build 21.0.5+11) -# Java VM: OpenJDK 64-Bit Server VM (21.0.5+11, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64) -# Problematic frame: -# C [libgallium-24.2.8-arch1.1.so+0x8eef41] -# -# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/cedric/ProgProjekt/Gruppe-01/Projekte/mdga/client/core.60653) -# -# If you would like to submit a bug report, please visit: -# https://bugreport.java.com/bugreport/crash.jsp -# The crash happened outside the Java Virtual Machine in native code. -# See problematic frame for where to report the bug. -# - ---------------- S U M M A R Y ------------ - -Command Line: -Ddebugger.agent.enable.coroutines=true -Djava.util.logging.config.file=logging.properties -Dkotlinx.coroutines.debug.enable.creation.stack.trace=false -Dkotlinx.coroutines.debug.enable.flows.stack.trace=true -Dkotlinx.coroutines.debug.enable.mutable.state.flows.stack.trace=true -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=127.0.0.1:39131 -javaagent:/usr/share/idea/plugins/java/lib/rt/debugger-agent.jar -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea pp.mdga.client.MdgaApp - -Host: AMD Ryzen 5 8640HS w/ Radeon 760M Graphics, 12 cores, 14G, Manjaro Linux -Time: Sun Dec 8 18:11:23 2024 CET elapsed time: 295.650309 seconds (0d 0h 4m 55s) - ---------------- T H R E A D --------------- - -Current thread (0x00007fc17ca803b0): JavaThread "jME3 Main" [_thread_in_native, id=60689, stack(0x00007fc159425000,0x00007fc159525000) (1024K)] - -Stack: [0x00007fc159425000,0x00007fc159525000], sp=0x00007fc159522300, free space=1012k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [libgallium-24.2.8-arch1.1.so+0x8eef41] -C [libgallium-24.2.8-arch1.1.so+0xf4a849] -C [libgallium-24.2.8-arch1.1.so+0x6ccb71] -C [libgallium-24.2.8-arch1.1.so+0x6c58ae] -C [libgallium-24.2.8-arch1.1.so+0x6c6013] -C [libgallium-24.2.8-arch1.1.so+0x6cddf8] -C [libgallium-24.2.8-arch1.1.so+0x141327] -C [libgallium-24.2.8-arch1.1.so+0x5fc8b] -C [libGLX_mesa.so.0+0x4f2e0] -C [libGLX_mesa.so.0+0x40496] -C [libGLX_mesa.so.0+0x2efa5] -J 2042 org.lwjgl.system.JNI.invokePV(JJ)V (0 bytes) @ 0x00007fc16c1abb6f [0x00007fc16c1abaa0+0x00000000000000cf] -J 4039 c1 org.lwjgl.glfw.GLFW.glfwSwapBuffers(J)V (21 bytes) @ 0x00007fc164d8684c [0x00007fc164d86760+0x00000000000000ec] -J 3912 c1 com.jme3.system.lwjgl.LwjglWindow.runLoop()V (177 bytes) @ 0x00007fc164d44b34 [0x00007fc164d442c0+0x0000000000000874] -j com.jme3.system.lwjgl.LwjglWindow.run()V+54 -j java.lang.Thread.runWith(Ljava/lang/Object;Ljava/lang/Runnable;)V+5 java.base@21.0.5 -j java.lang.Thread.run()V+19 java.base@21.0.5 -v ~StubRoutines::call_stub 0x00007fc16bb37cc6 -V [libjvm.so+0x6d0894] -V [libjvm.so+0x6d14fd] -V [libjvm.so+0x79a7be] -V [libjvm.so+0x6cac55] -V [libjvm.so+0x9d62c1] -C [libc.so.6+0x9439d] -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -J 2042 org.lwjgl.system.JNI.invokePV(JJ)V (0 bytes) @ 0x00007fc16c1abafc [0x00007fc16c1abaa0+0x000000000000005c] -J 4039 c1 org.lwjgl.glfw.GLFW.glfwSwapBuffers(J)V (21 bytes) @ 0x00007fc164d8684c [0x00007fc164d86760+0x00000000000000ec] -J 3912 c1 com.jme3.system.lwjgl.LwjglWindow.runLoop()V (177 bytes) @ 0x00007fc164d44b34 [0x00007fc164d442c0+0x0000000000000874] -j com.jme3.system.lwjgl.LwjglWindow.run()V+54 -j java.lang.Thread.runWith(Ljava/lang/Object;Ljava/lang/Runnable;)V+5 java.base@21.0.5 -j java.lang.Thread.run()V+19 java.base@21.0.5 -v ~StubRoutines::call_stub 0x00007fc16bb37cc6 - -siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x00000000000000c9 - -Registers: -RAX=0x0000000000000000, RBX=0x00007fc09825b2a0, RCX=0x0000000000000006, RDX=0x0000000028200000 -RSP=0x00007fc159522300, RBP=0x00007fc159522310, RSI=0x00007fc0998d3604, RDI=0x00007fc09825b7a0 -R8 =0x0000000000000006, R9 =0x00000000aa959a6a, R10=0x0000000000000263, R11=0x00007fc099bc36c0 -R12=0x00007fc0998d35e0, R13=0x000000058bc5f100, R14=0x000000058bc5f140, R15=0x0000000000000040 -RIP=0x00007fc14e0eef41, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000004 - TRAPNO=0x000000000000000e - - -Register to memory mapping: - -RAX=0x0 is null -RBX=0x00007fc09825b2a0 points into unknown readable memory: 0x00007fc098239c40 | 40 9c 23 98 c0 7f 00 00 -RCX=0x0000000000000006 is an unknown value -RDX=0x0000000028200000 is an unknown value -RSP=0x00007fc159522300 is pointing into the stack for thread: 0x00007fc17ca803b0 -RBP=0x00007fc159522310 is pointing into the stack for thread: 0x00007fc17ca803b0 -RSI=0x00007fc0998d3604 points into unknown readable memory: 00 00 00 00 -RDI=0x00007fc09825b7a0 points into unknown readable memory: 0x00001c7c00000265 | 65 02 00 00 7c 1c 00 00 -R8 =0x0000000000000006 is an unknown value -R9 =0x00000000aa959a6a is an unknown value -R10=0x0000000000000263 is an unknown value -R11=0x00007fc099bc36c0 points into unknown readable memory: 0x00007fc14e121570 | 70 15 12 4e c1 7f 00 00 -R12=0x00007fc0998d35e0 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00 -R13=0x000000058bc5f100 is an unknown value -R14=0x000000058bc5f140 is an unknown value -R15=0x0000000000000040 is an unknown value - -Top of Stack: (sp=0x00007fc159522300) -0x00007fc159522300: 00007fc09825b2a0 ffffffffffffffff -0x00007fc159522310: 00007fc1595223d0 00007fc14e74a849 -0x00007fc159522320: 0000000000000000 00000000cc0016c8 -0x00007fc159522330: 00007fc09920b000 00007fc100000004 -0x00007fc159522340: 00007fc100000001 00007fc100000000 -0x00007fc159522350: ffff800100000002 00007fc09825b7a0 -0x00007fc159522360: 00007fc1595223e0 0000000100000b02 -0x00007fc159522370: 0000000000000000 00007fc0983eca88 -0x00007fc159522380: 00007fc100000000 00007fc099e33780 -0x00007fc159522390: 00007fc159523170 b36c5690f9bb0900 -0x00007fc1595223a0: 00007fc15951fd20 00007fc0983eca80 -0x00007fc1595223b0: 00007fc09825b2a0 00007fc0983edb60 -0x00007fc1595223c0: 00007fc098415b10 00007fc0983ec850 -0x00007fc1595223d0: 00007fc159523280 00007fc14deccb71 -0x00007fc1595223e0: 00000bdc00000000 00007fc100000000 -0x00007fc1595223f0: 00007fc159523290 00007fc159523294 -0x00007fc159522400: 00007fc159523320 00007fc159523324 -0x00007fc159522410: 00007fc1595231b0 00007fc1595231b4 -0x00007fc159522420: 00007fc159522860 00007fc164c8401c -0x00007fc159522430: 00007fc159523310 00007fc159523314 -0x00007fc159522440: 00007fc1595232a0 00007fc1595232a4 -0x00007fc159522450: 00007fc159522860 00007fc159523334 -0x00007fc159522460: 00007fc159523400 00007fc159523404 -0x00007fc159522470: 00007fc1595232d0 00007fc1595232d4 -0x00007fc159522480: 00007fc16bc61f10 00007fc0c80123d0 -0x00007fc159522490: 00007fc1595231f0 00007fc1595231f4 -0x00007fc1595224a0: 00007fc1595223e0 00000000e31c914f -0x00007fc1595224b0: 00007fc159523350 00007fc159523354 -0x00007fc1595224c0: 00007fc1595232e0 00007fc1595232e4 -0x00007fc1595224d0: 00007f0000000000 00000000e3193478 -0x00007fc1595224e0: 00007fc159523440 00007fc159523444 -0x00007fc1595224f0: 00007fc159523310 00007fc159523314 - -Instructions: (pc=0x00007fc14e0eef41) -0x00007fc14e0eee41: 0f 1e fa 55 48 83 c6 24 48 89 e5 41 55 41 54 53 -0x00007fc14e0eee51: 48 89 fb 48 83 ec 08 8b 97 00 05 00 00 44 0f b7 -0x00007fc14e0eee61: 6e f0 48 8b 87 08 05 00 00 49 89 d4 45 01 ec 48 -0x00007fc14e0eee71: 8d 3c 90 42 8d 14 ad 00 00 00 00 ff 15 ee 7e c3 -0x00007fc14e0eee81: 01 44 89 a3 00 05 00 00 48 83 c4 08 5b 41 5c 41 -0x00007fc14e0eee91: 5d 5d c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 f3 -0x00007fc14e0eeea1: 0f 1e fa 55 48 89 e5 41 57 41 56 41 55 41 54 41 -0x00007fc14e0eeeb1: 89 f4 53 48 89 fb 48 83 ec 08 4e 8b b4 e7 88 09 -0x00007fc14e0eeec1: 00 00 8b 97 00 05 00 00 48 8b 87 08 05 00 00 45 -0x00007fc14e0eeed1: 0f b7 7e 14 49 89 d5 49 8d 76 24 48 8d 3c 90 45 -0x00007fc14e0eeee1: 01 fd 42 8d 14 bd 00 00 00 00 ff 15 7f 7e c3 01 -0x00007fc14e0eeef1: 44 89 ab 00 05 00 00 4e 89 b4 e3 d8 09 00 00 48 -0x00007fc14e0eef01: 83 c4 08 5b 41 5c 41 5d 41 5e 41 5f 5d c3 90 f3 -0x00007fc14e0eef11: 0f 1e fa 55 89 f0 48 89 e5 41 54 53 4c 8b a4 c7 -0x00007fc14e0eef21: 88 09 00 00 48 89 fb e8 73 ff ff ff 49 8b 84 24 -0x00007fc14e0eef31: 80 01 00 00 ba 00 00 20 28 48 8d bb 00 05 00 00 -0x00007fc14e0eef41: 0f b6 88 c9 00 00 00 48 8b b0 b0 00 00 00 48 8b -0x00007fc14e0eef51: 83 f0 04 00 00 ff 90 00 01 00 00 49 8b 04 24 48 -0x00007fc14e0eef61: 85 c0 74 13 48 89 df be ff ff ff ff 5b 41 5c 5d -0x00007fc14e0eef71: ff e0 0f 1f 44 00 00 5b 41 5c 5d c3 0f 1f 00 f3 -0x00007fc14e0eef81: 0f 1e fa 66 0f ef c0 31 c9 ba 01 00 00 00 0f 11 -0x00007fc14e0eef91: 87 d8 09 00 00 0f 11 87 e8 09 00 00 0f 11 87 f8 -0x00007fc14e0eefa1: 09 00 00 0f 11 87 08 0a 00 00 0f 11 87 18 0a 00 -0x00007fc14e0eefb1: 00 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 -0x00007fc14e0eefc1: 83 bc cf 88 09 00 00 00 74 0d 48 89 d0 48 d3 e0 -0x00007fc14e0eefd1: 48 09 87 80 09 00 00 48 83 c1 01 48 83 f9 0a 75 -0x00007fc14e0eefe1: de c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 -0x00007fc14e0eeff1: 0f 1e fa 55 48 89 e5 41 56 41 89 d6 41 55 41 89 -0x00007fc14e0ef001: f5 8d 34 b5 28 00 00 00 41 54 49 89 fc bf 01 00 -0x00007fc14e0ef011: 00 00 53 ff 15 7e 89 c3 01 48 89 c3 48 85 c0 74 -0x00007fc14e0ef021: 2a 66 44 89 68 1a 41 0f b6 ce 48 8d 78 08 41 0f -0x00007fc14e0ef031: b6 94 24 97 08 00 00 49 8d b4 24 90 02 00 00 c0 - - -Stack slot to memory mapping: - -stack at sp + 0 slots: 0x00007fc09825b2a0 points into unknown readable memory: 0x00007fc098239c40 | 40 9c 23 98 c0 7f 00 00 -stack at sp + 1 slots: 0xffffffffffffffff is an unknown value -stack at sp + 2 slots: 0x00007fc1595223d0 is pointing into the stack for thread: 0x00007fc17ca803b0 -stack at sp + 3 slots: 0x00007fc14e74a849: in /usr/lib/libgallium-24.2.8-arch1.1.so at 0x00007fc14d800000 -stack at sp + 4 slots: 0x0 is null -stack at sp + 5 slots: \ No newline at end of file diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/Asset.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/Asset.java index 9317f11d..715a5d92 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/Asset.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/Asset.java @@ -45,8 +45,7 @@ public enum Asset { tankShootTop("Models/tank/tankShoot_top.j3o", "Models/tank/tank_diff.png"), treesSmallBackground("Models/treeSmall/treesSmallBackground.j3o", "Models/treeSmall/treeSmall_diff.png", 1.2f), treesBigBackground("Models/treeBig/treesBigBackground.j3o", "Models/treeBig/treeBig_diff.png", 1.2f), - shell - ; + shell; private final String modelPath; private final String diffPath; @@ -83,7 +82,8 @@ public enum Asset { Asset(String modelPath) { String folderFileName = "./" + ROOT + name() + "/" + name(); this.modelPath = modelPath; - this.diffPath = folderFileName + "_diff.png";; + this.diffPath = folderFileName + "_diff.png"; + ; this.size = 1f; } @@ -106,7 +106,7 @@ public enum Asset { * @param diffPath Path to the diffuse texture file. * @param size Scaling factor for the asset. */ - Asset(String modelPath, String diffPath, float size){ + Asset(String modelPath, String diffPath, float size) { this.modelPath = modelPath; this.diffPath = diffPath; this.size = size; diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/InputSynchronizer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/InputSynchronizer.java index a643f203..39875eb0 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/InputSynchronizer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/InputSynchronizer.java @@ -12,19 +12,13 @@ import com.jme3.renderer.Camera; import com.jme3.scene.Node; import com.jme3.scene.control.AbstractControl; -import com.jme3.scene.control.Control; import pp.mdga.client.board.NodeControl; import pp.mdga.client.board.OutlineControl; import pp.mdga.client.board.PieceControl; import pp.mdga.client.gui.CardControl; import pp.mdga.client.gui.DiceControl; import pp.mdga.client.view.GameView; -import pp.mdga.game.BonusCard; import pp.mdga.game.Color; -import pp.mdga.game.Piece; -import pp.mdga.notification.FinishNotification; -import pp.mdga.notification.MovePieceNotification; -import pp.mdga.notification.SelectableCardsNotification; import java.util.List; import java.util.UUID; @@ -61,13 +55,13 @@ public class InputSynchronizer { } public void update(float tpf) { - if(isRotateLeft && isRotateRight) { + if (isRotateLeft && isRotateRight) { return; } - if(isRotateLeft) { + if (isRotateLeft) { rotationAngle += 180 * tpf; } - if(isRotateRight) { + if (isRotateRight) { rotationAngle -= 180 * tpf; } } @@ -94,6 +88,7 @@ private void setupInput() { inputManager.addListener(actionListener, "Settings", "Forward", "RotateRightMouse", "Click", "Left", "Right", "Test"); inputManager.addListener(analogListener, "MouseLeft", "MouseRight", "MouseScrollUp", "MouseScrollDown"); } + UUID p = null; /** * Handles action-based input events such as key presses and mouse clicks. @@ -110,8 +105,8 @@ public void onAction(String name, boolean isPressed, float tpf) { if (name.equals("RotateRightMouse")) { rightMousePressed = isPressed; } - if(name.equals("Click") && isPressed) { - if(!clickAllowed) { + if (name.equals("Click") && isPressed) { + if (!clickAllowed) { return; } @@ -120,23 +115,20 @@ public void onAction(String name, boolean isPressed, float tpf) { CardControl cardLayerSelect = checkHover(gameView.getGuiHandler().getCardLayerCamera(), gameView.getGuiHandler().getCardLayerRootNode(), CardControl.class); OutlineControl boardSelect = checkHover(app.getCamera(), app.getRootNode(), OutlineControl.class); - if(diceSelect != null) { + if (diceSelect != null) { app.getModelSynchronize().rolledDice(); - } - else if(cardLayerSelect != null) { + } else if (cardLayerSelect != null) { //cardSelect - if(cardLayerSelect.isSelectable()) gameView.getGuiHandler().selectCard(cardLayerSelect); - } - else if(boardSelect != null) { + if (cardLayerSelect.isSelectable()) gameView.getGuiHandler().selectCard(cardLayerSelect); + } else if (boardSelect != null) { //boardSelect - if(boardSelect instanceof PieceControl pieceControl){ - if(pieceControl.isSelectable()) gameView.getBoardHandler().pieceSelect(pieceControl); + if (boardSelect instanceof PieceControl pieceControl) { + if (pieceControl.isSelectable()) gameView.getBoardHandler().pieceSelect(pieceControl); } - if(boardSelect instanceof NodeControl nodeControl){ + if (boardSelect instanceof NodeControl nodeControl) { // } - } - else { + } else { //both null } } @@ -149,14 +141,14 @@ else if(boardSelect != null) { if (name.equals("Right")) { isRotateRight = !isRotateRight; } - if(name.equals("Test2") &&isPressed){ - if(app.getView() instanceof GameView gameView){ + if (name.equals("Test2") && isPressed) { + if (app.getView() instanceof GameView gameView) { - if(p == null) { + if (p == null) { p = UUID.randomUUID(); - gameView.getBoardHandler().addPlayer(Color.AIRFORCE,List.of(p,UUID.randomUUID(),UUID.randomUUID(),UUID.randomUUID())); - gameView.getBoardHandler().movePieceStartAnim(p,0); - gameView.getBoardHandler().outlineMove(List.of(p),List.of(2),List.of(false)); + gameView.getBoardHandler().addPlayer(Color.AIRFORCE, List.of(p, UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID())); + gameView.getBoardHandler().movePieceStartAnim(p, 0); + gameView.getBoardHandler().outlineMove(List.of(p), List.of(2), List.of(false)); //gameView.getBoardHandler().movePieceAnim(p,0, 8); } else { gameView.getBoardHandler().throwPiece(p, Color.ARMY); @@ -177,7 +169,6 @@ else if(boardSelect != null) { //gameView.getGuiHandler().playCardOwn(BonusCard.SHIELD); - } } } @@ -191,17 +182,13 @@ else if(boardSelect != null) { public void onAnalog(String name, float value, float tpf) { if (name.equals("MouseLeft") && rightMousePressed) { rotationAngle -= value * 360f; - } - else if (name.equals("MouseRight") && rightMousePressed) { + } else if (name.equals("MouseRight") && rightMousePressed) { rotationAngle += value * 360f; - } - else if (name.equals("MouseScrollUp")) { + } else if (name.equals("MouseScrollUp")) { scrollValue = Math.max(1, scrollValue - 5); - } - else if (name.equals("MouseScrollDown")) { + } else if (name.equals("MouseScrollDown")) { scrollValue = Math.min(100, scrollValue + 5); - } - else if (name.equals("MouseLeft") || name.equals("MouseRight") || name.equals("MouseVertical")){ + } else if (name.equals("MouseLeft") || name.equals("MouseRight") || name.equals("MouseVertical")) { hoverPiece(); hoverCard(); } @@ -212,12 +199,13 @@ else if (name.equals("MouseLeft") || name.equals("MouseRight") || name.equals("M * Detects the hovered piece and updates its hover state. */ private T checkHover(Camera cam, Node root, Class controlType) { - if(cam == null || root == null || controlType == null) return null; + if (cam == null || root == null || controlType == null) return null; CollisionResults results = new CollisionResults(); Ray ray = new Ray(cam.getLocation(), getMousePos(cam).subtract(cam.getLocation()).normalize()); root.collideWith(ray, results); - for(CollisionResult collisionResult : results){ - if(collisionResult.getGeometry().getControl(controlType) != null) return collisionResult.getGeometry().getControl(controlType); + for (CollisionResult collisionResult : results) { + if (collisionResult.getGeometry().getControl(controlType) != null) + return collisionResult.getGeometry().getControl(controlType); } return null; } @@ -226,16 +214,16 @@ private T checkHover(Camera cam, Node root, Class * Detects the hovered card and updates its hover state. */ private T checkHoverOrtho(Camera cam, Node root, Class controlType) { - if(cam == null || root == null || controlType == null) return null; + if (cam == null || root == null || controlType == null) return null; CollisionResults results = new CollisionResults(); Vector3f mousePos = getMousePos(cam); mousePos.setZ(cam.getLocation().getZ()); Ray ray = new Ray(mousePos, getMousePos(cam).subtract(mousePos).normalize()); root.collideWith(ray, results); if (results.size() > 0) { - for(CollisionResult res : results ){ + for (CollisionResult res : results) { T control = res.getGeometry().getControl(controlType); - if(control != null) return control; + if (control != null) return control; } } return null; @@ -297,9 +285,9 @@ private PieceControl checkPiece() { */ private CardControl checkCard(GameView gameView) { return checkHoverOrtho( - gameView.getGuiHandler().getCardLayerCamera(), - gameView.getGuiHandler().getCardLayerRootNode(), - CardControl.class + gameView.getGuiHandler().getCardLayerCamera(), + gameView.getGuiHandler().getCardLayerRootNode(), + CardControl.class ); } @@ -344,7 +332,7 @@ public float getRotation() { return (rotationAngle / 2) % 360; } - public void setRotation(float rotationAngle){ + public void setRotation(float rotationAngle) { this.rotationAngle = rotationAngle; } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/MdgaApp.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/MdgaApp.java index 6c1852d0..1487a306 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/MdgaApp.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/MdgaApp.java @@ -1,20 +1,14 @@ package pp.mdga.client; import com.jme3.app.SimpleApplication; -import com.simsilica.lemur.GuiGlobals; -import com.sun.tools.javac.Main; -import pp.mdga.client.acoustic.AcousticHandler; import com.jme3.system.AppSettings; +import com.simsilica.lemur.GuiGlobals; +import pp.mdga.client.acoustic.AcousticHandler; import pp.mdga.client.animation.TimerManager; import pp.mdga.client.dialog.JoinDialog; import pp.mdga.client.view.*; -import javax.imageio.ImageIO; import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.prefs.Preferences; @@ -27,40 +21,64 @@ public class MdgaApp extends SimpleApplication { private static Preferences prefs = Preferences.userNodeForPackage(JoinDialog.class); - /** Handles acoustic effects and state-based sounds. */ + /** + * Handles acoustic effects and state-based sounds. + */ private AcousticHandler acousticHandler; - /** Synchronizes notifications throughout the application. */ + /** + * Synchronizes notifications throughout the application. + */ private NotificationSynchronizer notificationSynchronizer; - /** Manages input events and synchronization. */ + /** + * Manages input events and synchronization. + */ private InputSynchronizer inputSynchronizer; - /** Synchronizes game models. */ + /** + * Synchronizes game models. + */ private ModelSynchronizer modelSynchronizer; - /** The currently active view in the application. */ + /** + * The currently active view in the application. + */ private MdgaView view = null; - /** The current state of the application. */ + /** + * The current state of the application. + */ private MdgaState state = null; - /** Scale for rendering images. */ + /** + * Scale for rendering images. + */ private final float imageScale = prefs.getInt("scale", 1); - /** The main menu view. */ + /** + * The main menu view. + */ private MainView mainView; - /** The lobby view. */ + /** + * The lobby view. + */ private LobbyView lobbyView; - /** The game view. */ + /** + * The game view. + */ private GameView gameView; - /** The ceremony view. */ + /** + * The ceremony view. + */ private CeremonyView ceremonyView; - /** The client game logic. */ + /** + * The client game logic. + */ private final ClientGameLogic clientGameLogic; private ExecutorService executor; @@ -87,7 +105,7 @@ public static void main(String[] args) { AppSettings settings = new AppSettings(true); settings.setSamples(128); - if(prefs.getBoolean("fullscreen", false)) { + if (prefs.getBoolean("fullscreen", false)) { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); int screenWidth = (int) screenSize.getWidth(); int screenHeight = (int) screenSize.getHeight(); @@ -270,12 +288,12 @@ public ExecutorService getExecutor() { return this.executor; } - public ServerConnection getNetworkSupport(){ + public ServerConnection getNetworkSupport() { return networkConnection; } public void updateResolution(int width, int height, float imageFactor, boolean isFullscreen) { - if(isFullscreen) { + if (isFullscreen) { int baseWidth = 1280; int baseHeight = 720; float baseAspectRatio = (float) baseWidth / baseHeight; @@ -306,7 +324,7 @@ public static void restartApp() { String className = System.getProperty("sun.java.command"); ProcessBuilder builder = new ProcessBuilder( - javaBin, "-cp", classPath, className + javaBin, "-cp", classPath, className ); builder.start(); @@ -326,7 +344,7 @@ public void afterGameCleanup() { ceremonyView.afterGameCleanup(); } - public GameView getGameView(){ + public GameView getGameView() { return gameView; } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/ModelSynchronizer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/ModelSynchronizer.java index 9971038b..a700188f 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/ModelSynchronizer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/ModelSynchronizer.java @@ -14,7 +14,7 @@ public class ModelSynchronizer { private UUID a; private UUID b; - private BonusCard card; + private BonusCard card; private boolean swap; ModelSynchronizer(MdgaApp app) { @@ -23,15 +23,15 @@ public class ModelSynchronizer { } public void animationEnd() { - if(app.getNotificationSynchronizer().waitForAnimation) { + if (app.getNotificationSynchronizer().waitForAnimation) { app.getNotificationSynchronizer().waitForAnimation = false; } else { app.getGameLogic().selectAnimationEnd(); } } - public void select(UUID a, UUID b){ - if(swap) selectSwap(a,b); + public void select(UUID a, UUID b) { + if (swap) selectSwap(a, b); else selectPiece(a); } @@ -42,7 +42,7 @@ public void selectSwap(UUID a, UUID b) { this.b = b; GameView gameView = (GameView) app.getView(); - if(a != null && b != null) { + if (a != null && b != null) { gameView.needConfirm(); } else { gameView.noConfirm(); @@ -56,7 +56,7 @@ public void selectPiece(UUID piece) { this.a = piece; GameView gameView = (GameView) app.getView(); - if(piece != null) { + if (piece != null) { gameView.needConfirm(); } else { gameView.noConfirm(); @@ -71,7 +71,7 @@ public void selectCard(BonusCard card) { GameView gameView = (GameView) app.getView(); - if(card != null) { + if (card != null) { gameView.needConfirm(); } else { gameView.showNoPower(); @@ -85,7 +85,7 @@ public void confirm() { gameView.getGuiHandler().hideText(); - if(a != null && b != null) { + if (a != null && b != null) { app.getGameLogic().selectPiece(a); app.getGameLogic().selectPiece(b); gameView.getBoardHandler().clearSelectable(); @@ -144,7 +144,7 @@ public void enter(MdgaState state) { //app.enter(state); } - public void setSwap(boolean swap){ + public void setSwap(boolean swap) { this.swap = swap; } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java index 6f5767d9..fb74e3d4 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java @@ -33,13 +33,13 @@ public class NotificationSynchronizer { public void update() { while (timer.getTimeInSeconds() >= delay) { - if(waitForAnimation) { + if (waitForAnimation) { return; } Notification n = app.getGameLogic().getNotification(); - if(n == null) { + if (n == null) { return; } @@ -48,12 +48,12 @@ public void update() { timer.reset(); delay = 0; - if(n instanceof InfoNotification infoNotification) { + if (n instanceof InfoNotification infoNotification) { app.getView().showInfo(infoNotification.getMessage(), infoNotification.isError()); return; } - if(n != null) { + if (n != null) { switch (app.getState()) { case MAIN: handleMain(n); @@ -71,7 +71,7 @@ public void update() { throw new RuntimeException("no notification expected: " + n.getClass().getName()); } - if(0 == MdgaApp.DEBUG_MULTIPLIER) { + if (0 == MdgaApp.DEBUG_MULTIPLIER) { delay = 0; } } @@ -84,7 +84,7 @@ private void handleMain(Notification notification) { } else if (notification instanceof StartDialogNotification) { //nothing } else { - throw new RuntimeException("notification not expected in main: "+ notification.getClass().getName()); + throw new RuntimeException("notification not expected in main: " + notification.getClass().getName()); } } @@ -98,7 +98,7 @@ private void handleLobby(Notification notification) { app.enter(MdgaState.MAIN); } else if (notification instanceof TskUnselectNotification n) { lobbyView.setTaken(n.getColor(), false, false, null); - } else if(notification instanceof LobbyReadyNotification lobbyReadyNotification) { + } else if (notification instanceof LobbyReadyNotification lobbyReadyNotification) { lobbyView.setReady(lobbyReadyNotification.getColor(), lobbyReadyNotification.isReady()); } else if (notification instanceof GameNotification n) { app.getGameView().setOwnColor(n.getOwnColor()); @@ -119,7 +119,7 @@ private void handleGame(Notification notification) { guiHandler.addCardOwn(n.getBonusCard()); app.getAcousticHandler().playSound(MdgaSound.BONUS); delay = STANDARD_DELAY; - } else if(notification instanceof RankingResponceNotification n) { + } else if (notification instanceof RankingResponceNotification n) { guiHandler.hideText(); n.getRankingResults().forEach((c, i) -> { guiHandler.rollRankingResult(c, i); @@ -129,7 +129,7 @@ private void handleGame(Notification notification) { guiHandler.hideText(); boardHandler.hideDice(); gameView.getGuiHandler().setActivePlayer(n.getColor()); - if(n.getColor() != ownColor) boardHandler.showDice(n.getColor()); + if (n.getColor() != ownColor) boardHandler.showDice(n.getColor()); app.getAcousticHandler().playSound(MdgaSound.UI90); delay = STANDARD_DELAY; } else if (notification instanceof CeremonyNotification ceremonyNotification) { @@ -138,11 +138,11 @@ private void handleGame(Notification notification) { int size = ceremonyNotification.getNames().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) { + 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."); } @@ -173,12 +173,11 @@ private void handleGame(Notification notification) { } else if (notification instanceof InterruptNotification notification1) { gameView.enterInterrupt(notification1.getColor()); } else if (notification instanceof MovePieceNotification n) { - if(n.isMoveStart()) { + if (n.isMoveStart()) { //StartMove boardHandler.movePieceStartAnim(n.getPiece(), n.getMoveIndex()); waitForAnimation = true; - } - else { + } else { //InfieldMove boardHandler.movePieceAnim(n.getPiece(), n.getStartIndex(), n.getMoveIndex()); waitForAnimation = true; @@ -190,15 +189,15 @@ private void handleGame(Notification notification) { } else if (notification instanceof RemoveShieldNotification n) { boardHandler.unshieldPiece(n.getPieceUuid()); } else if (notification instanceof PlayCardNotification n) { - if(n.getCard() == BonusCard.TURBO) { + if (n.getCard() == BonusCard.TURBO) { app.getAcousticHandler().playSound(MdgaSound.TURBO); guiHandler.turbo(); - } else if(n.getCard() == BonusCard.SHIELD) { + } else if (n.getCard() == BonusCard.SHIELD) { app.getAcousticHandler().playSound(MdgaSound.SHIELD); - } else if(n.getCard() == BonusCard.SWAP) { + } else if (n.getCard() == BonusCard.SWAP) { app.getAcousticHandler().playSound(MdgaSound.SWAP); } - if(n.getColor() == ownColor) guiHandler.playCardOwn(n.getCard()); + if (n.getColor() == ownColor) guiHandler.playCardOwn(n.getCard()); else guiHandler.playCardEnemy(n.getColor(), n.getCard()); new Timer().schedule(new TimerTask() { @@ -208,17 +207,16 @@ public void run() { } }, 2200 * MdgaApp.DEBUG_MULTIPLIER); } else if (notification instanceof PlayerInGameNotification n) { - boardHandler.addPlayer(n.getColor(),n.getPiecesList()); - guiHandler.addPlayer(n.getColor(),n.getName()); + boardHandler.addPlayer(n.getColor(), n.getPiecesList()); + guiHandler.addPlayer(n.getColor(), n.getName()); } else if (notification instanceof ResumeNotification) { gameView.leaveInterrupt(); } else if (notification instanceof RollDiceNotification n) { gameView.getGuiHandler().hideText(); - if(n.getColor() == ownColor){ + if (n.getColor() == ownColor) { guiHandler.rollDice(n.getEyes(), n.isTurbo() ? n.getMultiplier() : -1); waitForAnimation = true; - } - else { + } else { if (n.isTurbo()) guiHandler.showRolledDiceMult(n.getEyes(), n.getMultiplier(), n.getColor()); else guiHandler.showRolledDice(n.getEyes(), n.getColor()); } @@ -243,12 +241,12 @@ public void run() { } else if (notification instanceof SelectableSwapNotification n) { boardHandler.outlineSwap(n.getOwnPieces(), n.getEnemyPieces()); modelSynchronizer.setSwap(true); - } else if (notification instanceof SelectableShieldNotification n) { + } else if (notification instanceof SelectableShieldNotification n) { boardHandler.outlineShield(n.getPieces()); modelSynchronizer.setSwap(false); - } else if (notification instanceof TurboActiveNotification){ + } else if (notification instanceof TurboActiveNotification) { //nothing - } else if (notification instanceof FinishNotification n){ + } else if (notification instanceof FinishNotification n) { guiHandler.finish(n.getColorFinished()); } else { throw new RuntimeException("notification not expected in game: " + notification.getClass().getName()); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/Util.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/Util.java index 606c4beb..ec98b0dd 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/Util.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/Util.java @@ -3,14 +3,15 @@ import com.jme3.math.Vector3f; public class Util { - private Util(){} + private Util() { + } /** * Performs linear interpolation between two values. * * @param start The starting value. - * @param end The ending value. - * @param t A parameter between 0 and 1 representing the interpolation progress. + * @param end The ending value. + * @param t A parameter between 0 and 1 representing the interpolation progress. * @return The interpolated value. */ public static float linInt(float start, float end, float t) { @@ -23,7 +24,7 @@ public static float linInt(float start, float end, float t) { * @param p1 The initial point. * @param p2 The middle point. * @param p3 The final point. - * @param t The interpolation parameter (0 <= t <= 1). + * @param t The interpolation parameter (0 <= t <= 1). * @return The interpolated point. */ public static Vector3f quadInt(Vector3f p1, Vector3f p2, Vector3f p3, float t) { @@ -41,7 +42,7 @@ public static Vector3f quadInt(Vector3f p1, Vector3f p2, Vector3f p3, float t) { * @param x The interpolation parameter (0 <= x <= 1). * @return The adjusted interpolation value. */ - public static float easeInOut(float x){ + public static float easeInOut(float x) { return x < 0.5 ? 4 * x * x * x : (float) (1 - Math.pow(-2 * x + 2, 3) / 2); } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/AcousticHandler.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/AcousticHandler.java index 20ac40c4..e43ec87f 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/AcousticHandler.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/AcousticHandler.java @@ -4,7 +4,10 @@ import pp.mdga.client.MdgaApp; import pp.mdga.client.MdgaState; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.Random; import java.util.prefs.Preferences; public class AcousticHandler { @@ -226,20 +229,20 @@ private float lerp(float start, float end, float t) { /** * Updates the state of audio playback, handling track transitions and volume adjustments. - * + *

* This method ensures smooth transitions between tracks using fade-in and fade-out effects. * It also handles cases where no track is playing, starting a scheduled track immediately at full volume. * The method prioritizes the latest scheduled track if multiple scheduling occurs quickly. - * + *

* Behavior: * 1. If nothing is scheduled and no track is playing, it exits early. * 2. If a scheduled track exists and no track is playing, the scheduled track starts immediately at full volume. * 3. If a scheduled track exists while a track is playing, it initiates a fade-out for the currently playing track - * and prepares for the new track to fade in. + * and prepares for the new track to fade in. * 4. If a track transition is in progress (fading), it processes the fade-out and fade-in states. - * If a new track is scheduled during this process, it interrupts the current transition and prioritizes the new track. + * If a new track is scheduled during this process, it interrupts the current transition and prioritizes the new track. * 5. If no fading is needed and a track is playing, it ensures the track's volume is updated. - * + *

* Special cases: * - If no track is playing and a new track is scheduled, it starts the track immediately without fading. * - If a new track is scheduled during fading, it resets the transition to prioritize the new track. @@ -291,23 +294,23 @@ private void updateVolumeAndTrack() { /** * Manages the fading process during audio track transitions. - * + *

* This method handles the fade-out of the currently playing (old) track, manages any pause between the fade-out * and fade-in, and initiates the fade-in for the new track if applicable. It ensures smooth transitions between * tracks while maintaining the correct volume adjustments. - * + *

* Behavior: * 1. **Outfade:** Gradually decreases the volume of the `old` track over the duration of `FADE_DURATION`. - * Once the outfade completes, the `old` track is paused and cleared. + * Once the outfade completes, the `old` track is paused and cleared. * 2. **Pause Handling:** Waits for a defined pause (if applicable) before initiating the infade for the next track. * 3. **Infade:** If a `scheduled` track exists and the outfade and pause are complete, it begins playing - * the new track (`playing`) and initiates the infade process. - * + * the new track (`playing`) and initiates the infade process. + *

* Key Details: * - The outfade volume adjustment is interpolated linearly from full volume to zero using the `lerp` function. * - The pause duration is retrieved from the scheduled track if it is specified. * - If a new track is scheduled during the fade process, it is handled by external logic to prioritize transitions. - * + *

* Preconditions: * - `fading` is expected to be `true` when this method is called. * - The method is invoked as part of the `updateVolumeAndTrack` process. @@ -343,23 +346,23 @@ private void handleFadeProcess() { /** * Manages the fade-in process for the currently playing track. - * + *

* This method gradually increases the volume of the `playing` track from zero to full volume * over the duration of `CROSSFADE_DURATION`. It ensures a smooth transition into the new track. - * + *

* Behavior: * 1. If no track is set as `playing`, the method exits early, as there is nothing to fade in. * 2. Linearly interpolates the volume of the `playing` track from 0.0 to 1.0 based on the elapsed - * `infadeTime` and the specified `CROSSFADE_DURATION`. + * `infadeTime` and the specified `CROSSFADE_DURATION`. * 3. Once the fade-in is complete (when `infadeTime` exceeds `CROSSFADE_DURATION`), the method: - * - Marks the fade process (`fading`) as complete. - * - Ensures the `playing` track is updated to its full volume. - * + * - Marks the fade process (`fading`) as complete. + * - Ensures the `playing` track is updated to its full volume. + *

* Key Details: * - Uses the `lerp` function to calculate the volume level for the `playing` track during the fade-in. * - Ensures the volume is always a value between 0.0 and 1.0. * - The `infadeTime` parameter should be relative to the start of the fade-in process. - * + *

* Preconditions: * - The `playing` track must be initialized and actively fading in for this method to have an effect. * - The method is invoked as part of the `updateVolumeAndTrack` process. @@ -402,7 +405,7 @@ private void addGameTracks() { * a new track will be scheduled to play. If the list of game tracks is empty, it will be refreshed. */ private void updateGameTracks() { - if(null == playing) { + if (null == playing) { return; } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/SoundAssetDelayVolume.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/SoundAssetDelayVolume.java index a0fccb37..91fccf25 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/SoundAssetDelayVolume.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/acoustic/SoundAssetDelayVolume.java @@ -4,4 +4,5 @@ * A record that encapsulates a sound asset along with its playback settings: * the relative volume (subVolume) and a delay before it starts playing. */ -record SoundAssetDelayVolume(SoundAsset asset, float subVolume, float delay) {} +record SoundAssetDelayVolume(SoundAsset asset, float subVolume, float delay) { +} diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ActionControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ActionControl.java index 542a1f9c..2132b5d9 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ActionControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ActionControl.java @@ -5,14 +5,12 @@ public class ActionControl extends InitControl { private final Runnable runnable; - public ActionControl(Runnable runnable){ + public ActionControl(Runnable runnable) { this.runnable = runnable; } - - - protected void action(){ - if(null != runnable) { + protected void action() { + if (null != runnable) { runnable.run(); } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/Explosion.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/Explosion.java index 439e6ebc..a10f3e87 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/Explosion.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/Explosion.java @@ -47,13 +47,13 @@ public Explosion(MdgaApp app, Node rootNode, Vector3f location) { * Configures the fire and smoke emitters with appearance, behavior, and lifespan. */ private void initializeEmitter() { - fire = new ParticleEmitter("Effect", Type.Triangle,50); + fire = new ParticleEmitter("Effect", Type.Triangle, 50); fire.setMaterial(mat); fire.setImagesX(2); fire.setImagesY(2); fire.setStartColor(ColorRGBA.Yellow); fire.setEndColor(ColorRGBA.Red); - fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0.2f,0.2f,4f)); + fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0.2f, 0.2f, 4f)); fire.getParticleInfluencer().setVelocityVariation(0.4f); fire.setStartSize(0.7f); fire.setEndSize(1.8f); @@ -64,13 +64,13 @@ private void initializeEmitter() { fire.setLocalTranslation(location); - smoke = new ParticleEmitter("Effect2", Type.Triangle,40); + smoke = new ParticleEmitter("Effect2", Type.Triangle, 40); smoke.setMaterial(mat); smoke.setImagesX(3); smoke.setImagesY(3); smoke.setStartColor(ColorRGBA.DarkGray); smoke.setEndColor(new ColorRGBA(0.05f, 0.05f, 0.05f, 1)); - smoke.getParticleInfluencer().setInitialVelocity(new Vector3f(0.0f,0.0f,0.7f)); + smoke.getParticleInfluencer().setInitialVelocity(new Vector3f(0.0f, 0.0f, 0.7f)); smoke.getParticleInfluencer().setVelocityVariation(0.5f); smoke.setStartSize(0.8f); smoke.setEndSize(1.5f); @@ -109,7 +109,8 @@ protected void controlUpdate(float tpf) { } @Override - protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) {} + protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) { + } }); rootNode.attachChild(smoke); @@ -127,7 +128,8 @@ protected void controlUpdate(float tpf) { } @Override - protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) {} + protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) { + } }); } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/FadeControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/FadeControl.java index 8f4b2ccf..12fe7f26 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/FadeControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/FadeControl.java @@ -1,10 +1,9 @@ package pp.mdga.client.animation; -import com.jme3.renderer.queue.RenderQueue; -import com.jme3.scene.Geometry; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; -import pp.mdga.client.InitControl; +import com.jme3.renderer.queue.RenderQueue; +import com.jme3.scene.Geometry; import static pp.mdga.client.Util.linInt; diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/JetAnimation.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/JetAnimation.java index 13dc23ee..6fde39a1 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/JetAnimation.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/JetAnimation.java @@ -12,10 +12,6 @@ import pp.mdga.client.Asset; import pp.mdga.client.MdgaApp; import pp.mdga.client.acoustic.MdgaSound; -import pp.mdga.client.board.BoardHandler; -import pp.mdga.client.view.GameView; - -import java.util.UUID; /** * The {@code JetAnimation} class handles the animation of a jet model in a 3D environment. @@ -38,10 +34,10 @@ public class JetAnimation { /** * Constructor for the {@code JetAnimation} class. * - * @param app The main application managing the jet animation. - * @param rootNode The root node to which the jet model will be attached. - * @param targetPoint The target point where the explosion will occur. - * @param curveHeight The height of the curve for the jet's flight path. + * @param app The main application managing the jet animation. + * @param rootNode The root node to which the jet model will be attached. + * @param targetPoint The target point where the explosion will occur. + * @param curveHeight The height of the curve for the jet's flight path. * @param animationDuration The total duration of the jet animation. */ public JetAnimation(MdgaApp app, Node rootNode, Vector3f targetPoint, float curveHeight, float animationDuration, Runnable actionAfter) { @@ -88,7 +84,8 @@ private void spawnJet() { rootNode.attachChild(jetModel); } - /**actionAfter + /** + * actionAfter * Animates the jet along a Bezier curve path, triggers the explosion effect at the appropriate time, * and performs cleanup operations after the animation completes. */ @@ -106,7 +103,7 @@ protected void controlUpdate(float tpf) { elapsedTime += tpf; float progress = elapsedTime / animationDuration; - if(elapsedTime > 4.2f) { + if (elapsedTime > 4.2f) { explosion.trigger(); } @@ -127,11 +124,12 @@ protected void controlUpdate(float tpf) { } @Override - protected void controlRender(RenderManager rm, ViewPort vp) {} + protected void controlRender(RenderManager rm, ViewPort vp) { + } }); } - private void endAnim(){ + private void endAnim() { actionAfter.run(); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MatrixAnimation.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MatrixAnimation.java index e525d06e..0d8d4fe8 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MatrixAnimation.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MatrixAnimation.java @@ -6,11 +6,11 @@ import com.jme3.material.RenderState; import com.jme3.math.ColorRGBA; import com.jme3.math.Vector3f; -import pp.mdga.client.InitControl; import pp.mdga.client.MdgaApp; -import pp.mdga.client.acoustic.MdgaSound; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; public class MatrixAnimation extends ActionControl { private MdgaApp app; @@ -23,7 +23,7 @@ public class MatrixAnimation extends ActionControl { private float timeElapsed = 0f; - private enum MatrixState{ + private enum MatrixState { RADAR_ON, RADAR_OFF, MATRIX_ON, @@ -32,7 +32,7 @@ private enum MatrixState{ private MatrixState state; - public MatrixAnimation(MdgaApp app, Vector3f radarPos, Runnable runnable){ + public MatrixAnimation(MdgaApp app, Vector3f radarPos, Runnable runnable) { super(runnable); this.app = app; this.radarPos = radarPos; @@ -48,15 +48,14 @@ protected void initSpatial() { @Override protected void controlUpdate(float tpf) { - if(!init) return; + if (!init) return; timeElapsed += tpf; - - switch(state){ + switch (state) { case RADAR_ON -> { - if(timeElapsed >= 2f){ + if (timeElapsed >= 2f) { state = MatrixState.RADAR_OFF; timeElapsed = 0; radarEmitter.setParticlesPerSec(0); @@ -68,7 +67,7 @@ protected void controlUpdate(float tpf) { } } case RADAR_OFF -> { - if(timeElapsed >= 0.1f){ + if (timeElapsed >= 0.1f) { state = MatrixState.MATRIX_ON; timeElapsed = 0; matrix(); @@ -76,12 +75,12 @@ protected void controlUpdate(float tpf) { } case MATRIX_ON -> { - if(timeElapsed >= 3f){ + if (timeElapsed >= 3f) { state = MatrixState.MATRIX_OFF; timeElapsed = 0; turnOff(); app.getTimerManager().addTask(3f, () -> app.enqueue(() -> { - for (ParticleEmitter particleEmitter : activeEmitter){ + for (ParticleEmitter particleEmitter : activeEmitter) { app.getRootNode().detachChild(particleEmitter); } System.out.println("delete particle"); @@ -90,7 +89,7 @@ protected void controlUpdate(float tpf) { } } case MATRIX_OFF -> { - if(timeElapsed >= 0.5f){ + if (timeElapsed >= 0.5f) { init = false; spatial.removeControl(this); action(); @@ -99,13 +98,13 @@ protected void controlUpdate(float tpf) { } } - private void turnOff(){ - for (ParticleEmitter particleEmitter : activeEmitter){ + private void turnOff() { + for (ParticleEmitter particleEmitter : activeEmitter) { particleEmitter.setParticlesPerSec(0f); } } - private void radar(){ + private void radar() { Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); mat.setTexture("Texture", app.getAssetManager().loadTexture("Images/particle/radar_beam.png")); ParticleEmitter emitter = new ParticleEmitter("Effect", Type.Triangle, 50); @@ -123,26 +122,26 @@ private void radar(){ float life = 2.6f; emitter.setLowLife(life); emitter.setHighLife(life); - emitter.setLocalTranslation(radarPos.add(new Vector3f(0,0,5))); + emitter.setLocalTranslation(radarPos.add(new Vector3f(0, 0, 5))); emitter.setParticlesPerSec(1.8f); app.getRootNode().attachChild(emitter); radarEmitter = emitter; } - private void matrix(){ - for(int i = 0; i < 5; i++){ - particleStream( - generateMatrixColor(), - generateMatrixColor(), - getRandomFloat(0,1f), - getRandomPosition(), - getRandomFloat(1,2) - ); - } + private void matrix() { + for (int i = 0; i < 5; i++) { + particleStream( + generateMatrixColor(), + generateMatrixColor(), + getRandomFloat(0, 1f), + getRandomPosition(), + getRandomFloat(1, 2) + ); + } } - private void particleStream(ColorRGBA start, ColorRGBA end, float speedVar, Vector3f pos, float spawnVar){ + private void particleStream(ColorRGBA start, ColorRGBA end, float speedVar, Vector3f pos, float spawnVar) { Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha); mat.setTexture("Texture", app.getAssetManager().loadTexture("Images/particle/particle_cir.png")); @@ -160,7 +159,7 @@ private void particleStream(ColorRGBA start, ColorRGBA end, float speedVar, Vect matrix.setGravity(0, 0, 2f); matrix.setLowLife(3f); matrix.setHighLife(3f); - matrix.setLocalTranslation(spatial.getLocalTranslation().add(pos).add(new Vector3f(0,0,15))); + matrix.setLocalTranslation(spatial.getLocalTranslation().add(pos).add(new Vector3f(0, 0, 15))); matrix.setParticlesPerSec(spawnVar); app.getRootNode().attachChild(matrix); activeEmitter.add(matrix); @@ -178,7 +177,7 @@ public static Vector3f getRandomPosition() { float x = radius * (float) Math.cos(angle); float y = radius * (float) Math.sin(angle); - return new Vector3f(x,y,0); + return new Vector3f(x, y, 0); } public static float getRandomFloat(float start, float end) { diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MissileAnimation.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MissileAnimation.java index 90cca657..d7f7d67f 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MissileAnimation.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MissileAnimation.java @@ -17,8 +17,6 @@ import pp.mdga.client.acoustic.MdgaSound; import pp.mdga.client.board.BoardHandler; -import java.util.UUID; - /** * The {@code MissileAnimation} class handles the animation of a missile moving along a parabolic path * towards a target point in a 3D environment. It also triggers an explosion at the target upon impact. @@ -42,9 +40,9 @@ public class MissileAnimation { /** * Constructor for the {@code MissileAnimation} class. * - * @param app The main application managing the missile animation. - * @param rootNode The root node to which the missile model will be attached. - * @param target The target point where the missile will explode. + * @param app The main application managing the missile animation. + * @param rootNode The root node to which the missile model will be attached. + * @param target The target point where the missile will explode. * @param flightTime The total flight time of the missile. */ public MissileAnimation(MdgaApp app, Node rootNode, Vector3f target, float flightTime, Runnable actionAfter) { @@ -64,13 +62,13 @@ public MissileAnimation(MdgaApp app, Node rootNode, Vector3f target, float fligh this.mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); mat.setTexture("Texture", app.getAssetManager().loadTexture("Images/particle/vapor_cloud.png")); - smoke = new ParticleEmitter("Effect2", ParticleMesh.Type.Triangle,400); + smoke = new ParticleEmitter("Effect2", ParticleMesh.Type.Triangle, 400); smoke.setMaterial(mat); smoke.setImagesX(3); smoke.setImagesY(3); smoke.setStartColor(ColorRGBA.DarkGray); smoke.setEndColor(new ColorRGBA(0.05f, 0.05f, 0.05f, 1)); - smoke.getParticleInfluencer().setInitialVelocity(new Vector3f(0.0f,0.0f,0.0f)); + smoke.getParticleInfluencer().setInitialVelocity(new Vector3f(0.0f, 0.0f, 0.0f)); smoke.getParticleInfluencer().setVelocityVariation(0.1f); smoke.setStartSize(0.8f); smoke.setEndSize(1.5f); @@ -120,7 +118,7 @@ private void animateMissile() { @Override protected void controlUpdate(float tpf) { - if(elapsedTime > 6) { + if (elapsedTime > 6) { endAnim(); rootNode.detachChild(missileNode); this.spatial.removeControl(this); @@ -150,8 +148,8 @@ protected void controlUpdate(float tpf) { missileNode.setLocalTranslation(currentPosition); Vector3f direction = computeParabolicPath(start, target, progress + 0.01f) - .subtract(currentPosition) - .normalizeLocal(); + .subtract(currentPosition) + .normalizeLocal(); missileModel.lookAt(currentPosition.add(direction), Vector3f.UNIT_Y); missileModel.rotate(0, FastMath.HALF_PI, 0); } @@ -162,16 +160,16 @@ protected void controlRender(RenderManager rm, ViewPort vp) { }); } - private void endAnim(){ + private void endAnim() { actionAfter.run(); } /** * Computes a position along a parabolic path at a given progress value {@code t}. * - * @param start The starting point of the missile's flight. + * @param start The starting point of the missile's flight. * @param target The target point of the missile's flight. - * @param t The progress value (0.0 to 1.0) along the flight path. + * @param t The progress value (0.0 to 1.0) along the flight path. * @return The interpolated position along the parabolic path. */ private Vector3f computeParabolicPath(Vector3f start, Vector3f target, float t) { diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MoveControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MoveControl.java index 5dacacbd..a80b2b27 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MoveControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/MoveControl.java @@ -2,7 +2,8 @@ import com.jme3.math.Vector3f; -import static pp.mdga.client.Util.*; +import static pp.mdga.client.Util.easeInOut; +import static pp.mdga.client.Util.quadInt; /** * A control that smoothly moves a spatial from an initial position to an end position @@ -28,15 +29,15 @@ public class MoveControl extends ActionControl { * Creates a new MoveControl with specified initial and end positions, and an action to run after the movement. * The movement follows a path with a midpoint at a fixed height. * - * @param initPos The starting position of the spatial. - * @param endPos The target position of the spatial. + * @param initPos The starting position of the spatial. + * @param endPos The target position of the spatial. * @param actionAfter A Runnable that will be executed after the movement finishes. */ - public MoveControl(Vector3f initPos, Vector3f endPos, Runnable actionAfter){ + public MoveControl(Vector3f initPos, Vector3f endPos, Runnable actionAfter) { this(initPos, endPos, actionAfter, 2, 1, true); } - public MoveControl(Vector3f initPos, Vector3f endPos, Runnable actionAfter, float height, float duration, boolean easing){ + public MoveControl(Vector3f initPos, Vector3f endPos, Runnable actionAfter, float height, float duration, boolean easing) { super(actionAfter); moving = false; this.initPos = initPos; @@ -70,7 +71,7 @@ protected void initSpatial() { */ @Override protected void controlUpdate(float tpf) { - if(!moving) return; + if (!moving) return; timer += tpf; float t = timer / duration; @@ -78,22 +79,20 @@ protected void controlUpdate(float tpf) { float interpolated = easing ? easeInOut(t) : t; - spatial.setLocalTranslation(quadInt(initPos,middlePos,endPos, interpolated)); + spatial.setLocalTranslation(quadInt(initPos, middlePos, endPos, interpolated)); - if(t >= 1) end(); + if (t >= 1) end(); } /** * Ends the movement by stopping the interpolation, running the action after the movement, * and removing this control from the spatial. */ - private void end(){ + private void end() { moving = false; spatial.removeControl(this); action(); } - - } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ShellAnimation.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ShellAnimation.java index 8a9325cb..b72564f1 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ShellAnimation.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ShellAnimation.java @@ -3,17 +3,12 @@ import com.jme3.effect.ParticleEmitter; import com.jme3.effect.ParticleMesh; import com.jme3.material.Material; -import com.jme3.material.RenderState; import com.jme3.math.ColorRGBA; import com.jme3.math.FastMath; import com.jme3.math.Quaternion; import com.jme3.math.Vector3f; -import com.jme3.renderer.queue.RenderQueue; -import com.jme3.scene.Geometry; import com.jme3.scene.Spatial; -import com.jme3.scene.shape.Box; import pp.mdga.client.Asset; -import pp.mdga.client.InitControl; import pp.mdga.client.MdgaApp; import pp.mdga.client.acoustic.MdgaSound; import pp.mdga.client.board.TankTopControl; @@ -22,7 +17,6 @@ import java.util.TimerTask; import static com.jme3.material.Materials.LIGHTING; -import static com.jme3.material.Materials.UNSHADED; public class ShellAnimation extends ActionControl { private static final float FLYING_DURATION = 1.25f; @@ -30,7 +24,7 @@ public class ShellAnimation extends ActionControl { private TankTopControl tankTopControl; private MdgaApp app; - public ShellAnimation(TankTopControl tankTopControl, MdgaApp app, Runnable actionAfter){ + public ShellAnimation(TankTopControl tankTopControl, MdgaApp app, Runnable actionAfter) { super(actionAfter); this.tankTopControl = tankTopControl; this.app = app; @@ -44,14 +38,14 @@ protected void initSpatial() { app.getRootNode().attachChild(createShell()); } - private Vector3f getShootPos(){ + private Vector3f getShootPos() { Vector3f localOffset = new Vector3f(0, -5.4f, 2.9f); Quaternion turretRotation = tankTopControl.getSpatial().getLocalRotation(); Vector3f transformedOffset = turretRotation.mult(localOffset); return tankTopControl.getSpatial().getLocalTranslation().add(transformedOffset); } - private void shoot(){ + private void shoot() { app.getAcousticHandler().playSound(MdgaSound.TANK_SHOOT); Vector3f shootPos = getShootPos(); createEffect( @@ -71,7 +65,7 @@ private void shoot(){ 0.3f, 0.8f, 10, 0.1f, 0.35f, - new ColorRGBA(0.5f,0.5f,0.5f,0.5f), + new ColorRGBA(0.5f, 0.5f, 0.5f, 0.5f), ColorRGBA.Black ); @@ -80,7 +74,7 @@ private void shoot(){ shell.addControl(new ShellControl(this::hitExplosion, shootPos, spatial.getLocalTranslation(), FLYING_HEIGHT, FLYING_DURATION, app.getAssetManager())); } - private Spatial createShell(){ + private Spatial createShell() { Spatial model = app.getAssetManager().loadModel(Asset.shell.getModelPath()); model.scale(.16f); model.setLocalTranslation(tankTopControl.getSpatial().getLocalTranslation()); @@ -90,21 +84,21 @@ private Spatial createShell(){ Vector3f direction = targetPos.subtract(shootPos).normalize(); Quaternion rotation = new Quaternion(); - rotation.lookAt(direction, new Vector3f(1,0,0)); // Assuming UNIT_Y is the up vector + rotation.lookAt(direction, new Vector3f(1, 0, 0)); // Assuming UNIT_Y is the up vector model.setLocalRotation(rotation); - model.rotate(FastMath.HALF_PI,0,0); + model.rotate(FastMath.HALF_PI, 0, 0); Material mat = new Material(app.getAssetManager(), LIGHTING); mat.setBoolean("UseMaterialColors", true); - ColorRGBA color = ColorRGBA.fromRGBA255(143,117,0,255); + ColorRGBA color = ColorRGBA.fromRGBA255(143, 117, 0, 255); mat.setColor("Diffuse", color); mat.setColor("Ambient", color); model.setMaterial(mat); return model; } - private void hitExplosion(){ + private void hitExplosion() { app.getAcousticHandler().playSound(MdgaSound.TANK_EXPLOSION); createEffect( spatial.getLocalTranslation().setZ(1), @@ -130,7 +124,7 @@ private void createEffect(Vector3f shootPos, float startSize, float endSize, float velocity, float lowLife, float highLife, - ColorRGBA start, ColorRGBA end){ + ColorRGBA start, ColorRGBA end) { // Create a particle emitter for the explosion ParticleEmitter explosionEmitter = new ParticleEmitter("Explosion", ParticleMesh.Type.Triangle, 100); Material explosionMat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ShellControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ShellControl.java index 72cd7bb8..0dc560a2 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ShellControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ShellControl.java @@ -7,7 +7,6 @@ import com.jme3.math.ColorRGBA; import com.jme3.math.FastMath; import com.jme3.math.Vector3f; -import pp.mdga.client.InitControl; public class ShellControl extends ActionControl { private final Vector3f shootPos; @@ -18,7 +17,7 @@ public class ShellControl extends ActionControl { private ParticleEmitter emitter; private AssetManager assetManager; - public ShellControl(Runnable runnable, Vector3f shootPos, Vector3f endPos, float height, float duration, AssetManager assetManager){ + public ShellControl(Runnable runnable, Vector3f shootPos, Vector3f endPos, float height, float duration, AssetManager assetManager) { super(runnable); this.shootPos = shootPos; this.endPos = endPos; @@ -32,7 +31,7 @@ protected void initSpatial() { spatial.addControl(new MoveControl( shootPos, endPos, - ()->{ + () -> { emitter.killAllParticles(); emitter.setParticlesPerSec(0); emitter.removeFromParent(); @@ -80,7 +79,7 @@ protected void controlUpdate(float tpf) { Vector3f direction = spatial.getLocalTranslation().subtract(oldPos).normalize(); if (direction.lengthSquared() > 0) { spatial.getLocalRotation().lookAt(direction, Vector3f.UNIT_X); - spatial.rotate(FastMath.HALF_PI,0,0); + spatial.rotate(FastMath.HALF_PI, 0, 0); } oldPos = spatial.getLocalTranslation().clone(); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/Smoke.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/Smoke.java index 1786a656..503698a8 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/Smoke.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/Smoke.java @@ -43,11 +43,11 @@ public Smoke(MdgaApp app, Node rootNode, Vector3f location) { * Configures the fire and smoke emitters with appearance, behavior, and lifespan. */ private void initializeEmitter() { - fire = new ParticleEmitter("Effect", ParticleMesh.Type.Triangle,50); + fire = new ParticleEmitter("Effect", ParticleMesh.Type.Triangle, 50); fire.setMaterial(mat); fire.setStartColor(ColorRGBA.DarkGray); fire.setEndColor(ColorRGBA.DarkGray); - fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0.2f,0.2f,4f)); + fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0.2f, 0.2f, 4f)); fire.getParticleInfluencer().setVelocityVariation(0.4f); fire.setStartSize(0.7f); fire.setEndSize(3.8f); @@ -58,13 +58,13 @@ private void initializeEmitter() { fire.setLocalTranslation(location); - smoke = new ParticleEmitter("Effect2", ParticleMesh.Type.Triangle,40); + smoke = new ParticleEmitter("Effect2", ParticleMesh.Type.Triangle, 40); smoke.setMaterial(mat); smoke.setImagesX(2); smoke.setImagesY(2); smoke.setStartColor(ColorRGBA.DarkGray); smoke.setEndColor(new ColorRGBA(0.05f, 0.05f, 0.05f, 1)); - smoke.getParticleInfluencer().setInitialVelocity(new Vector3f(0.0f,0.0f,2f)); + smoke.getParticleInfluencer().setInitialVelocity(new Vector3f(0.0f, 0.0f, 2f)); smoke.getParticleInfluencer().setVelocityVariation(0.5f); smoke.setStartSize(0.5f); smoke.setEndSize(1.5f); @@ -103,7 +103,8 @@ protected void controlUpdate(float tpf) { } @Override - protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) {} + protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) { + } }); rootNode.attachChild(smoke); @@ -121,7 +122,8 @@ protected void controlUpdate(float tpf) { } @Override - protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) {} + protected void controlRender(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) { + } }); } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/SymbolControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/SymbolControl.java index 1abf533c..cafdc38b 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/SymbolControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/SymbolControl.java @@ -172,8 +172,8 @@ public void turbo() { * Performs linear interpolation between two values. * * @param start The starting value. - * @param end The target value. - * @param t The interpolation parameter (0 <= t <= 1). + * @param end The target value. + * @param t The interpolation parameter (0 <= t <= 1). * @return The interpolated value. */ private static float lerp(float start, float end, float t) { diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ZoomControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ZoomControl.java index eb4319cd..65b9d1e2 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ZoomControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/animation/ZoomControl.java @@ -17,8 +17,8 @@ public class ZoomControl extends InitControl { private float zoomFactor = 1f; /** - * Constructs a new ZoomControl with the default zoom speed. - */ + * Constructs a new ZoomControl with the default zoom speed. + */ public ZoomControl() { } @@ -78,8 +78,8 @@ private void end() { * Performs linear interpolation between two values. * * @param start The starting value. - * @param end The target value. - * @param t The interpolation parameter (0 <= t <= 1). + * @param end The target value. + * @param t The interpolation parameter (0 <= t <= 1). * @return The interpolated value. */ private static float lerp(float start, float end, float t) { diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/AssetOnMap.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/AssetOnMap.java index ac6bdf53..3b56393c 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/AssetOnMap.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/AssetOnMap.java @@ -5,4 +5,5 @@ /** * Record for holding Asset information */ -record AssetOnMap(Asset asset, int x, int y, float rot) {} +record AssetOnMap(Asset asset, int x, int y, float rot) { +} diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java index 346e0483..499874d0 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java @@ -2,7 +2,6 @@ import com.jme3.material.Material; import com.jme3.material.RenderState; -import com.jme3.material.RenderState.BlendMode; import com.jme3.math.ColorRGBA; import com.jme3.math.Vector3f; import com.jme3.post.FilterPostProcessor; @@ -66,13 +65,13 @@ public class BoardHandler { /** * Creates a new BoardHandler. * - * @param app The main application instance + * @param app The main application instance * @param rootNode The root node where the board will be attached - * @param fpp The post-processor for effects like shadows or filters + * @param fpp The post-processor for effects like shadows or filters * @throws RuntimeException if the app is null */ public BoardHandler(MdgaApp app, Node rootNode, FilterPostProcessor fpp) { - if(app == null) throw new RuntimeException("app is null"); + if (app == null) throw new RuntimeException("app is null"); this.app = app; this.fpp = fpp; @@ -99,7 +98,7 @@ public void init() { /** * Shuts down the board handler by detaching all board-related nodes and clearing selected pieces. */ - public void shutdown(){ + public void shutdown() { clearSelectable(); isInitialised = false; rootNode.detachChild(rootNodeBoard); @@ -108,7 +107,7 @@ public void shutdown(){ /** * Adds an asset to the map of player assets, ensuring that the player does not have too many assets. * - * @param col The color of the player + * @param col The color of the player * @param assetOnMap The asset to be added * @throws RuntimeException if there are too many assets for the player */ @@ -129,7 +128,7 @@ private void initMap() { waitingPiecesMap = new HashMap<>(); pieceColor = new HashMap<>(); diceControl = new DiceControl(app.getAssetManager()); - diceControl.create(new Vector3f(0,0,0), 0.7f, true); + diceControl.create(new Vector3f(0, 0, 0), 0.7f, true); waitingNodes = new HashMap<>(); waitingNodes.put(Color.AIRFORCE, new HashMap<>()); waitingNodes.put(Color.ARMY, new HashMap<>()); @@ -146,7 +145,7 @@ private void initMap() { case cir -> addFigureToPlayerMap(assetToColor(Asset.cir), assetOnMap); case marine -> addFigureToPlayerMap(assetToColor(Asset.marine), assetOnMap); case node_normal, node_bonus, node_start -> - infield.add(displayAndControl(assetOnMap, new NodeControl(app, fpp))); + infield.add(displayAndControl(assetOnMap, new NodeControl(app, fpp))); case node_home_black -> addHomeNode(homeNodesMap, Color.AIRFORCE, assetOnMap); case node_home_blue -> addHomeNode(homeNodesMap, Color.NAVY, assetOnMap); case node_home_green -> addHomeNode(homeNodesMap, Color.ARMY, assetOnMap); @@ -194,8 +193,8 @@ private Color assetToColor(Asset asset) { * Creates a 3D model of an asset and adds it to the board. * * @param asset The asset to be displayed - * @param pos The position of the asset on the board - * @param rot The rotation of the asset + * @param pos The position of the asset on the board + * @param rot The rotation of the asset * @return The Spatial representation of the asset */ private Spatial createModel(Asset asset, Vector3f pos, float rot) { @@ -262,19 +261,19 @@ private T displayAndControl(AssetOnMap assetOnMap, T * @param pieceControl The control managing the piece to be moved. * @param nodeControl The control managing the target node to which the piece will move. */ - private void movePieceToNode(PieceControl pieceControl, NodeControl nodeControl){ + private void movePieceToNode(PieceControl pieceControl, NodeControl nodeControl) { pieceControl.setLocation(nodeControl.getLocation()); } /** * Adds a home node for a specific player color, attaching it to the map of home nodes. * - * @param map The map storing lists of home nodes by player color. - * @param color The color associated with the home nodes to be added. - * @param assetOnMap The asset representing the home node in the 3D environment. + * @param map The map storing lists of home nodes by player color. + * @param color The color associated with the home nodes to be added. + * @param assetOnMap The asset representing the home node in the 3D environment. * @throws RuntimeException if more than 4 home nodes are added for a single color. */ - private void addHomeNode(Map> map, Color color, AssetOnMap assetOnMap){ + private void addHomeNode(Map> map, Color color, AssetOnMap assetOnMap) { List homeNodes = addItemToMapList(map, color, displayAndControl(assetOnMap, new NodeControl(app, fpp))); if (homeNodes.size() > 4) throw new RuntimeException("too many homeNodes for " + color); } @@ -290,19 +289,19 @@ private float getRotationMove(Vector3f prev, Vector3f next) { Vector3f direction = next.subtract(prev).normalizeLocal(); //I had to reverse dir.y, because then it worked. float newRot = (float) Math.toDegrees(Math.atan2(direction.x, -direction.y)); - if(newRot < 0) newRot += 360; + if (newRot < 0) newRot += 360; return newRot; } /** - * Recursively moves a piece from its current index to the destination index, - * to keep track of the piece rotation. - * - * @param uuid The UUID of the piece to move. - * @param curIndex The current index of the piece. - * @param moveIndex The target index to move the piece to. + * Recursively moves a piece from its current index to the destination index, + * to keep track of the piece rotation. + * + * @param uuid The UUID of the piece to move. + * @param curIndex The current index of the piece. + * @param moveIndex The target index to move the piece to. */ - private void movePieceRek(UUID uuid, int curIndex, int moveIndex){ + private void movePieceRek(UUID uuid, int curIndex, int moveIndex) { if (curIndex == moveIndex) return; int nextIndex = (curIndex + 1) % infield.size(); @@ -311,7 +310,7 @@ private void movePieceRek(UUID uuid, int curIndex, int moveIndex){ NodeControl nodeCur = infield.get(curIndex); NodeControl nodeMove = infield.get(nextIndex); - pieceControl.setRotation(getRotationMove(nodeCur.getLocation(),nodeMove.getLocation())); + pieceControl.setRotation(getRotationMove(nodeCur.getLocation(), nodeMove.getLocation())); movePieceToNode(pieceControl, nodeMove); @@ -329,7 +328,7 @@ private void movePieceRek(UUID uuid, int curIndex, int moveIndex){ * @param The type of the key in the map. * @return The updated list associated with the specified key. */ - private List addItemToMapList(Map> map, E key, T item){ + private List addItemToMapList(Map> map, E key, T item) { List list = map.getOrDefault(key, new ArrayList<>()); list.add(item); map.put(key, list); @@ -345,7 +344,7 @@ private List addItemToMapList(Map> map, E key, T item){ * @param The type of items in the list. * @param The type of the key in the map. */ - private void removeItemFromMapList(Map> map, E key, T item){ + private void removeItemFromMapList(Map> map, E key, T item) { List list = map.getOrDefault(key, new ArrayList<>()); list.remove(item); map.put(key, list); @@ -357,7 +356,7 @@ private void removeItemFromMapList(Map> map, E key, T item){ * @param color The color associated with the waiting nodes. * @return The mean position of the waiting nodes as a {@code Vector3f}. */ - private Vector3f getWaitingPos(Color color){ + private Vector3f getWaitingPos(Color color) { return getMeanPosition(waitingNodesMap.get(color).stream().map(NodeControl::getLocation).toList()); } @@ -381,20 +380,22 @@ public static Vector3f getMeanPosition(List vectors) { * Adds a player to the game by associating a color and a list of UUIDs to corresponding assets and waiting nodes. * * @param color the color of the player - * @param uuid the list of UUIDs representing the player's assets + * @param uuid the list of UUIDs representing the player's assets * @throws RuntimeException if the number of assets or waiting nodes does not match the provided UUIDs */ public void addPlayer(Color color, List uuid) { List playerAssets = colorAssetsMap.get(color); if (playerAssets == null) throw new RuntimeException("Assets for Player color are not defined"); - if (uuid.size() != playerAssets.size()) throw new RuntimeException("UUID array and playerAssets are not the same size"); + if (uuid.size() != playerAssets.size()) + throw new RuntimeException("UUID array and playerAssets are not the same size"); List waitNodes = waitingNodesMap.get(color); - if (waitNodes.size() != playerAssets.size()) throw new RuntimeException("waitNodes size does not match playerAssets size"); + if (waitNodes.size() != playerAssets.size()) + throw new RuntimeException("waitNodes size does not match playerAssets size"); - for (int i = 0; i < playerAssets.size(); i++){ + for (int i = 0; i < playerAssets.size(); i++) { AssetOnMap assetOnMap = playerAssets.get(i); UUID pieceUuid = uuid.get(i); @@ -419,18 +420,18 @@ public void addPlayer(Color color, List uuid) { /** * Moves a piece to its corresponding home node based on the given index. * - * @param uuid the UUID of the piece to move + * @param uuid the UUID of the piece to move * @param index the index of the home node to move the piece to * @throws RuntimeException if the UUID is not mapped to a color or if the home nodes are not properly defined */ - private void moveHomePiece(UUID uuid, int index){ + private void moveHomePiece(UUID uuid, int index) { Color color = pieceColor.get(uuid); - if(color == null) throw new RuntimeException("uuid is not mapped to a color"); + if (color == null) throw new RuntimeException("uuid is not mapped to a color"); List homeNodes = homeNodesMap.get(color); - if(homeNodesMap.size() != 4) throw new RuntimeException("HomeNodes for" + color + " are not properly defined"); + if (homeNodesMap.size() != 4) throw new RuntimeException("HomeNodes for" + color + " are not properly defined"); PieceControl pieceControl = pieces.get(uuid); NodeControl nodeControl = homeNodes.get(index); @@ -438,7 +439,7 @@ private void moveHomePiece(UUID uuid, int index){ //rotate piece in direction of homeNodes NodeControl firstHomeNode = homeNodes.get(0); - NodeControl lastHomeNode = homeNodes.get(homeNodes.size()-1); + NodeControl lastHomeNode = homeNodes.get(homeNodes.size() - 1); pieceControl.setRotation(getRotationMove(firstHomeNode.getLocation(), lastHomeNode.getLocation())); app.getModelSynchronize().animationEnd(); @@ -448,12 +449,12 @@ private void moveHomePiece(UUID uuid, int index){ /** * Starts the movement of a piece to a target node based on the given index. * - * @param uuid the UUID of the piece to move + * @param uuid the UUID of the piece to move * @param nodeIndex the index of the target node to move the piece to - * @throws RuntimeException if the UUID is not mapped to a color or the piece control is not found + * @throws RuntimeException if the UUID is not mapped to a color or the piece control is not found * @throws IllegalArgumentException if the node index is invalid */ - private void movePieceStart(UUID uuid, int nodeIndex){ + private void movePieceStart(UUID uuid, int nodeIndex) { // Farbe des Pieces abrufen Color color = pieceColor.get(uuid); @@ -480,11 +481,11 @@ private void movePieceStart(UUID uuid, int nodeIndex){ /** * Moves a piece from its current position to the target position based on the given indexes. * - * @param uuid the UUID of the piece to move - * @param curIndex the current index of the piece + * @param uuid the UUID of the piece to move + * @param curIndex the current index of the piece * @param moveIndex the target index of the move */ - private void movePiece(UUID uuid, int curIndex, int moveIndex){ + private void movePiece(UUID uuid, int curIndex, int moveIndex) { movePieceRek(uuid, curIndex, moveIndex); app.getModelSynchronize().animationEnd(); @@ -497,7 +498,7 @@ private void movePiece(UUID uuid, int curIndex, int moveIndex){ * @param uuid the UUID of the piece to throw * @throws RuntimeException if the UUID is not mapped to a color or if no available waiting nodes are found */ - private void throwPiece(UUID uuid){ + private void throwPiece(UUID uuid) { // Farbe des Pieces abrufen Color color = pieceColor.get(uuid); @@ -531,7 +532,7 @@ private void throwPiece(UUID uuid){ * * @param uuid the UUID of the piece to shield */ - public void shieldPiece(UUID uuid){ + public void shieldPiece(UUID uuid) { pieces.get(uuid).activateShield(); } @@ -540,7 +541,7 @@ public void shieldPiece(UUID uuid){ * * @param uuid the UUID of the piece to unshield */ - public void unshieldPiece(UUID uuid){ + public void unshieldPiece(UUID uuid) { pieces.get(uuid).deactivateShield(); } @@ -549,7 +550,7 @@ public void unshieldPiece(UUID uuid){ * * @param uuid the UUID of the piece to suppress the shield */ - public void suppressShield(UUID uuid){ + public void suppressShield(UUID uuid) { pieces.get(uuid).suppressShield(); } @@ -557,14 +558,14 @@ public void suppressShield(UUID uuid){ /** * Swaps the positions and rotations of two pieces. * - * @param p1 the first piece to swap - * @param p2 the second piece to swap + * @param p1 the first piece to swap + * @param p2 the second piece to swap * @param loc1 the original location of the first piece * @param rot1 the original rotation of the first piece * @param loc2 the original location of the second piece * @param rot2 the original rotation of the second piece */ - private void swapPieces(PieceControl p1, PieceControl p2, Vector3f loc1, float rot1, Vector3f loc2, float rot2){ + private void swapPieces(PieceControl p1, PieceControl p2, Vector3f loc1, float rot1, Vector3f loc2, float rot2) { p1.setLocation(loc2); p2.setLocation(loc1); @@ -577,13 +578,14 @@ private void swapPieces(PieceControl p1, PieceControl p2, Vector3f loc1, float r /** * Outlines the possible move nodes for a list of pieces based on the move indices and whether it's a home move. * - * @param pieces the list of UUIDs representing the pieces to outline + * @param pieces the list of UUIDs representing the pieces to outline * @param moveIndexe the list of indices for the target move nodes - * @param homeMoves the list indicating whether the move is a home move + * @param homeMoves the list indicating whether the move is a home move * @throws RuntimeException if the sizes of the input lists do not match */ public void outlineMove(List pieces, List moveIndexe, List homeMoves) { - if(pieces.size() != moveIndexe.size() || pieces.size() != homeMoves.size()) throw new RuntimeException("arrays are not the same size"); + if (pieces.size() != moveIndexe.size() || pieces.size() != homeMoves.size()) + throw new RuntimeException("arrays are not the same size"); selectableEnemyPieces.clear(); selectableOwnPieces.clear(); @@ -598,8 +600,7 @@ public void outlineMove(List pieces, List moveIndexe, List pieces, List moveIndexe, List ownPieces, List enemyPieces){ + public void outlineSwap(List ownPieces, List enemyPieces) { selectableEnemyPieces.clear(); selectableOwnPieces.clear(); selectedOwnPiece = null; selectedEnemyPiece = null; - for(UUID uuid : ownPieces) { + for (UUID uuid : ownPieces) { PieceControl p = pieces.get(uuid); p.highlight(false); p.setHoverable(true); p.setSelectable(true); selectableOwnPieces.add(p); } - for(UUID uuid : enemyPieces) { + for (UUID uuid : enemyPieces) { PieceControl p = pieces.get(uuid); p.highlight(true); p.setHoverable(true); @@ -646,13 +647,13 @@ public void outlineSwap(List ownPieces, List enemyPieces){ * * @param pieces the list of UUIDs representing the pieces to be shielded */ - public void outlineShield(List pieces){ + public void outlineShield(List pieces) { selectableOwnPieces.clear(); selectableEnemyPieces.clear(); selectedOwnPiece = null; selectedEnemyPiece = null; - for (UUID uuid : pieces){ + for (UUID uuid : pieces) { PieceControl p = this.pieces.get(uuid); p.highlight(false); p.setHoverable(true); @@ -668,69 +669,65 @@ public void outlineShield(List pieces){ */ public void pieceSelect(PieceControl pieceSelected) { boolean isSelected = pieceSelected.isSelected(); - if(selectableOwnPieces.contains(pieceSelected)){ - for(PieceControl p : selectableOwnPieces) { + if (selectableOwnPieces.contains(pieceSelected)) { + for (PieceControl p : selectableOwnPieces) { p.unSelect(); - if(selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unSelect(); + if (selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unSelect(); } if (!isSelected) { pieceSelected.select(); - if(selectedPieceNodeMap.get(pieceSelected) != null) selectedPieceNodeMap.get(pieceSelected).select(); + if (selectedPieceNodeMap.get(pieceSelected) != null) selectedPieceNodeMap.get(pieceSelected).select(); selectedOwnPiece = pieceSelected; - } - else { + } else { pieceSelected.unSelect(); - if(selectedPieceNodeMap.get(pieceSelected) != null) selectedPieceNodeMap.get(pieceSelected).unSelect(); + if (selectedPieceNodeMap.get(pieceSelected) != null) selectedPieceNodeMap.get(pieceSelected).unSelect(); selectedOwnPiece = null; } - } - else if(selectableEnemyPieces.contains(pieceSelected)) { - for(PieceControl p : selectableEnemyPieces) { + } else if (selectableEnemyPieces.contains(pieceSelected)) { + for (PieceControl p : selectableEnemyPieces) { p.unSelect(); } if (!isSelected) { pieceSelected.select(); selectedEnemyPiece = pieceSelected; - } - else { + } else { pieceSelected.unSelect(); selectedEnemyPiece = null; } - } - else throw new RuntimeException("pieceSelected is not in own/enemySelectablePieces"); + } else throw new RuntimeException("pieceSelected is not in own/enemySelectablePieces"); app.getModelSynchronize().select(getKeyByValue(pieces, selectedOwnPiece), getKeyByValue(pieces, selectedEnemyPiece)); } - public void pieceHoverOn(PieceControl hoverPiece){ + public void pieceHoverOn(PieceControl hoverPiece) { hoverPiece.hover(); - if(selectedPieceNodeMap.get(hoverPiece) != null) selectedPieceNodeMap.get(hoverPiece).hover(); + if (selectedPieceNodeMap.get(hoverPiece) != null) selectedPieceNodeMap.get(hoverPiece).hover(); } - public void pieceHoverOff(PieceControl hoverPiece){ + public void pieceHoverOff(PieceControl hoverPiece) { hoverPiece.hoverOff(); - if(selectedPieceNodeMap.get(hoverPiece) != null) selectedPieceNodeMap.get(hoverPiece).hoverOff(); + if (selectedPieceNodeMap.get(hoverPiece) != null) selectedPieceNodeMap.get(hoverPiece).hoverOff(); } /** * Clears all highlighted, selectable, and selected pieces and nodes. */ - public void clearSelectable(){ - for(PieceControl p : selectableEnemyPieces) { + public void clearSelectable() { + for (PieceControl p : selectableEnemyPieces) { p.unSelect(); p.unHighlight(); p.setSelectable(false); p.setHoverable(false); - if(selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unSelect(); - if(selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unHighlight(); + if (selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unSelect(); + if (selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unHighlight(); } - for(PieceControl p : selectableOwnPieces) { + for (PieceControl p : selectableOwnPieces) { p.unSelect(); p.unHighlight(); p.setSelectable(false); p.setHoverable(false); } - for(NodeControl n : outlineNodes){ + for (NodeControl n : outlineNodes) { n.deOutline(); } outlineNodes.clear(); @@ -746,16 +743,16 @@ public void clearSelectable(){ * * @param color the color of the player whose dice should be displayed */ - public void showDice(Color color){ + public void showDice(Color color) { rootNodeBoard.attachChild(diceControl.getSpatial()); - diceControl.setPos(getWaitingPos(color).add(new Vector3f(0,0,4))); + diceControl.setPos(getWaitingPos(color).add(new Vector3f(0, 0, 4))); diceControl.spin(); } /** * Hides the dice from the view. */ - public void hideDice(){ + public void hideDice() { diceControl.hide(); } @@ -771,42 +768,42 @@ private K getKeyByValue(Map map, V value) { /** * Animates the movement of a piece from its current index to a target index. * - * @param uuid the UUID of the piece to animate - * @param curIndex the current index of the piece + * @param uuid the UUID of the piece to animate + * @param curIndex the current index of the piece * @param moveIndex the target index to animate the piece to */ - public void movePieceAnim(UUID uuid, int curIndex, int moveIndex){ + public void movePieceAnim(UUID uuid, int curIndex, int moveIndex) { pieces.get(uuid).getSpatial().addControl(new MoveControl( - infield.get(curIndex).getLocation(), - infield.get(moveIndex).getLocation(), - ()->movePiece(uuid,curIndex,moveIndex))); + infield.get(curIndex).getLocation(), + infield.get(moveIndex).getLocation(), + () -> movePiece(uuid, curIndex, moveIndex))); } /** * Animates the movement of a piece to its home position based on the given home index. * - * @param uuid the UUID of the piece to animate + * @param uuid the UUID of the piece to animate * @param homeIndex the index of the home node to move the piece to */ - public void movePieceHomeAnim(UUID uuid, int homeIndex){ + public void movePieceHomeAnim(UUID uuid, int homeIndex) { pieces.get(uuid).getSpatial().addControl(new MoveControl( - pieces.get(uuid).getLocation(), - homeNodesMap.get(pieceColor.get(uuid)).get(homeIndex).getLocation(), - ()->moveHomePiece(uuid,homeIndex))); + pieces.get(uuid).getLocation(), + homeNodesMap.get(pieceColor.get(uuid)).get(homeIndex).getLocation(), + () -> moveHomePiece(uuid, homeIndex))); } /** * Animates the start of the movement of a piece to a target index. * - * @param uuid the UUID of the piece to animate + * @param uuid the UUID of the piece to animate * @param moveIndex the target index to animate the piece to */ - public void movePieceStartAnim(UUID uuid, int moveIndex){ + public void movePieceStartAnim(UUID uuid, int moveIndex) { pieces.get(uuid).getSpatial().addControl(new MoveControl( - pieces.get(uuid).getLocation(), - infield.get(moveIndex).getLocation(), - ()->movePieceStart(uuid, moveIndex) + pieces.get(uuid).getLocation(), + infield.get(moveIndex).getLocation(), + () -> movePieceStart(uuid, moveIndex) )); } @@ -815,15 +812,15 @@ public void movePieceStartAnim(UUID uuid, int moveIndex){ * * @param uuid the UUID of the piece to animate */ - public void throwPieceAnim(UUID uuid){ + public void throwPieceAnim(UUID uuid) { pieces.get(uuid).getSpatial().addControl(new MoveControl( - pieces.get(uuid).getLocation(), getNextWaitingNode(pieceColor.get(uuid)).getLocation(), - ()->throwPiece(uuid)) + pieces.get(uuid).getLocation(), getNextWaitingNode(pieceColor.get(uuid)).getLocation(), + () -> throwPiece(uuid)) ); } - public void throwPiece(UUID uuid, Color throwColor){ - switch(throwColor){ + public void throwPiece(UUID uuid, Color throwColor) { + switch (throwColor) { case ARMY -> throwShell(uuid); case NAVY -> throwMissile(uuid); case CYBER -> throwMatrix(uuid); @@ -840,14 +837,14 @@ public void throwPiece(UUID uuid, Color throwColor){ private void throwBomb(UUID uuid) { Vector3f targetPoint = pieces.get(uuid).getLocation(); - JetAnimation anim = new JetAnimation(app, rootNode, targetPoint, 40, 6, ()->throwPieceAnim(uuid)); + JetAnimation anim = new JetAnimation(app, rootNode, targetPoint, 40, 6, () -> throwPieceAnim(uuid)); anim.start(); } private void throwMatrix(UUID uuid) { app.getAcousticHandler().playSound(MdgaSound.MATRIX); Spatial piece = pieces.get(uuid).getSpatial(); - piece.addControl(new MatrixAnimation(app, radarPos,()-> { + piece.addControl(new MatrixAnimation(app, radarPos, () -> { throwPieceAnim(uuid); })); } @@ -855,12 +852,12 @@ private void throwMatrix(UUID uuid) { private void throwMissile(UUID uuid) { Vector3f targetPoint = pieces.get(uuid).getLocation(); - MissileAnimation anim = new MissileAnimation(app, rootNode, targetPoint, 2f, ()->throwPieceAnim(uuid)); + MissileAnimation anim = new MissileAnimation(app, rootNode, targetPoint, 2f, () -> throwPieceAnim(uuid)); anim.start(); } private void throwShell(UUID uuid) { - pieces.get(uuid).getSpatial().addControl(new ShellAnimation(tankTop, app, ()-> throwPieceAnim(uuid))); + pieces.get(uuid).getSpatial().addControl(new ShellAnimation(tankTop, app, () -> throwPieceAnim(uuid))); } /** @@ -869,7 +866,7 @@ private void throwShell(UUID uuid) { * @param piece1 the UUID of the first piece * @param piece2 the UUID of the second piece */ - public void swapPieceAnim(UUID piece1, UUID piece2){ + public void swapPieceAnim(UUID piece1, UUID piece2) { PieceControl piece1Control = pieces.get(piece1); PieceControl piece2Control = pieces.get(piece2); @@ -879,14 +876,15 @@ public void swapPieceAnim(UUID piece1, UUID piece2){ float rot2 = piece2Control.getRotation(); piece1Control.getSpatial().addControl(new MoveControl( - piece1Control.getLocation().clone(), - piece2Control.getLocation().clone(), - ()->{} + piece1Control.getLocation().clone(), + piece2Control.getLocation().clone(), + () -> { + } )); piece2Control.getSpatial().addControl(new MoveControl( - piece2Control.getLocation().clone(), - piece1Control.getLocation().clone(), - ()->swapPieces(piece1Control,piece2Control,loc1,rot1,loc2,rot2) + piece2Control.getLocation().clone(), + piece1Control.getLocation().clone(), + () -> swapPieces(piece1Control, piece2Control, loc1, rot1, loc2, rot2) )); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/CameraHandler.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/CameraHandler.java index 431f74a7..e4825488 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/CameraHandler.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/CameraHandler.java @@ -73,7 +73,7 @@ public CameraHandler(MdgaApp app, FilterPostProcessor fpp) { // ssaoFilter = new SSAOFilter(); fxaaFilter = new FXAAFilter(); - sky = SkyFactory.createSky(app.getAssetManager(), "Images/sky/sky.dds", EnvMapType.EquirectMap).rotate(FastMath.HALF_PI*1,0,FastMath.HALF_PI*0.2f); + sky = SkyFactory.createSky(app.getAssetManager(), "Images/sky/sky.dds", EnvMapType.EquirectMap).rotate(FastMath.HALF_PI * 1, 0, FastMath.HALF_PI * 0.2f); } @@ -94,7 +94,7 @@ public void init(Color ownColor) { init = true; initRot = true; this.ownColor = ownColor; - app.getInputSynchronize().setRotation(getInitAngleByColor(ownColor)*2); + app.getInputSynchronize().setRotation(getInitAngleByColor(ownColor) * 2); } /** @@ -120,11 +120,11 @@ public void shutdown() { * Updates the camera position and rotation based on user input (scroll and rotation). * Adjusts the vertical angle and radius based on zoom and rotation values. * - * @param scroll The scroll input, determining zoom level. + * @param scroll The scroll input, determining zoom level. * @param rotation The rotation input, determining camera orientation. */ public void update(float scroll, float rotation) { - if(!init) return; + if (!init) return; float scrollValue = Math.max(0, Math.min(scroll, 100)); float rotationValue = rotation % 360; @@ -162,8 +162,8 @@ public void update(float scroll, float rotation) { * @param color The color used to determine the camera angle. * @return The camera angle in degrees. */ - private float getAngleByColor(Color color){ - return switch (color){ + private float getAngleByColor(Color color) { + return switch (color) { case ARMY -> 0; case AIRFORCE -> 90; case NAVY -> 270; @@ -178,7 +178,7 @@ private float getAngleByColor(Color color){ * @param color The color used to determine the camera angle. * @return The initial camera angle in degrees. */ - private float getInitAngleByColor(Color color){ + private float getInitAngleByColor(Color color) { return (getAngleByColor(color) + 180) % 360; } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/MapLoader.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/MapLoader.java index fe994855..77c1ead3 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/MapLoader.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/MapLoader.java @@ -28,15 +28,15 @@ private MapLoader() { * * @param mapName The name of the map file to load. The file is expected to be located in the resources directory. * @return A list of {@link AssetOnMap} objects representing the assets placed on the map. - * @throws IOException If an error occurs while reading the map file. + * @throws IOException If an error occurs while reading the map file. * @throws IllegalArgumentException If the map file contains invalid data. */ public static List loadMap(String mapName) { List assetsOnMap = new ArrayList<>(); try ( - InputStream inputStream = MapLoader.class.getClassLoader().getResourceAsStream(mapName); - BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)) + InputStream inputStream = MapLoader.class.getClassLoader().getResourceAsStream(mapName); + BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)) ) { while (true) { @@ -65,11 +65,9 @@ public static List loadMap(String mapName) { Asset asset = getLoadedAsset(assetName); assetsOnMap.add(new AssetOnMap(asset, x, y, rot)); } - } - catch (IOException e) { + } catch (IOException e) { e.printStackTrace(); - } - catch (IllegalArgumentException e) { + } catch (IllegalArgumentException e) { e.printStackTrace(); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/NodeControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/NodeControl.java index 9f37b9be..5eb363a8 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/NodeControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/NodeControl.java @@ -3,9 +3,6 @@ import com.jme3.math.ColorRGBA; import com.jme3.math.Vector3f; import com.jme3.post.FilterPostProcessor; -import com.jme3.renderer.RenderManager; -import com.jme3.renderer.ViewPort; -import com.jme3.scene.control.AbstractControl; import pp.mdga.client.MdgaApp; /** @@ -40,38 +37,38 @@ public NodeControl(MdgaApp app, FilterPostProcessor fpp) { * * @return The {@link Vector3f} representing the node's location. */ - public Vector3f getLocation(){ + public Vector3f getLocation() { return this.getSpatial().getLocalTranslation(); } - public void highlight(){ + public void highlight() { highlight = true; super.outline(OUTLINE_HIGHLIGHT_COLOR, OUTLINE_HIGHLIGHT_WIDTH); } - public void unHighlight(){ + public void unHighlight() { highlight = false; deOutline(); } - public void select(){ + public void select() { select = true; super.outline(OUTLINE_SELECT_COLOR, OUTLINE_SELECT_WIDTH); } - public void unSelect(){ + public void unSelect() { select = false; - if(highlight) highlight(); + if (highlight) highlight(); else deOutline(); } - public void hover(){ + public void hover() { super.outline(OUTLINE_HOVER_COLOR, OUTLINE_HOVER_WIDTH); } - public void hoverOff(){ - if(select) select(); - else if(highlight) highlight(); + public void hoverOff() { + if (select) select(); + else if (highlight) highlight(); else deOutline(); } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineControl.java index aa1a999b..1ff12334 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineControl.java @@ -3,8 +3,8 @@ import com.jme3.math.ColorRGBA; import com.jme3.post.FilterPostProcessor; import com.jme3.renderer.Camera; -import pp.mdga.client.MdgaApp; import pp.mdga.client.InitControl; +import pp.mdga.client.MdgaApp; import pp.mdga.client.outline.SelectObjectOutliner; /** @@ -13,7 +13,9 @@ * object, allowing it to be highlighted or deselected. */ public class OutlineControl extends InitControl { - /** The {@link SelectObjectOutliner} responsible for managing the outline effect. */ + /** + * The {@link SelectObjectOutliner} responsible for managing the outline effect. + */ private final SelectObjectOutliner outlineOwn; private static final int THICKNESS_DEFAULT = 6; private MdgaApp app; @@ -24,7 +26,7 @@ public class OutlineControl extends InitControl { * @param app The main application managing the outline control. * @param fpp The {@code FilterPostProcessor} used for post-processing effects. */ - public OutlineControl(MdgaApp app, FilterPostProcessor fpp){ + public OutlineControl(MdgaApp app, FilterPostProcessor fpp) { this.app = app; outlineOwn = new SelectObjectOutliner(THICKNESS_DEFAULT, fpp, app.getRenderManager(), app.getAssetManager(), app.getCamera(), app); } @@ -36,7 +38,7 @@ public OutlineControl(MdgaApp app, FilterPostProcessor fpp){ * @param fpp The {@code FilterPostProcessor} used for post-processing effects. * @param cam The camera used for rendering the outlined objects. */ - public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam){ + public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam) { this.app = app; outlineOwn = new SelectObjectOutliner(THICKNESS_DEFAULT, fpp, app.getRenderManager(), app.getAssetManager(), cam, app); } @@ -49,7 +51,7 @@ public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam){ * @param cam The camera used for rendering the outlined objects. * @param thickness The thickness of the outline. */ - public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, int thickness){ + public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, int thickness) { this.app = app; outlineOwn = new SelectObjectOutliner(thickness, fpp, app.getRenderManager(), app.getAssetManager(), cam, app); } @@ -59,7 +61,7 @@ public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, int thic * * @param color The {@link ColorRGBA} representing the color of the outline. */ - public void outline(ColorRGBA color){ + public void outline(ColorRGBA color) { outlineOwn.select(spatial, color); } @@ -69,7 +71,7 @@ public void outline(ColorRGBA color){ * @param color The {@link ColorRGBA} representing the color of the outline. * @param width The width of the outline. */ - public void outline(ColorRGBA color, int width){ + public void outline(ColorRGBA color, int width) { deOutline(); outlineOwn.select(spatial, color, width); } @@ -77,7 +79,7 @@ public void outline(ColorRGBA color, int width){ /** * Removes the outline effect from the spatial object. */ - public void deOutline(){ + public void deOutline() { outlineOwn.deselect(spatial); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/PieceControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/PieceControl.java index d317342f..9342e668 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/PieceControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/PieceControl.java @@ -55,10 +55,10 @@ public class PieceControl extends OutlineControl { * * @param initRotation The initial rotation of the piece in degrees. * @param assetManager The {@link AssetManager} used for loading models and materials. - * @param app The {@link MdgaApp} instance to use for the application context. - * @param fpp The {@link FilterPostProcessor} to apply post-processing effects. + * @param app The {@link MdgaApp} instance to use for the application context. + * @param fpp The {@link FilterPostProcessor} to apply post-processing effects. */ - public PieceControl(float initRotation, AssetManager assetManager, MdgaApp app, FilterPostProcessor fpp){ + public PieceControl(float initRotation, AssetManager assetManager, MdgaApp app, FilterPostProcessor fpp) { super(app, fpp); this.parentNode = new Node(); this.initRotation = initRotation; @@ -79,7 +79,7 @@ public PieceControl(float initRotation, AssetManager assetManager, MdgaApp app, * @return The rotation of the piece in degrees. */ public float getRotation() { - return (float) Math.toDegrees(spatial.getLocalRotation().toAngleAxis(new Vector3f(0,0,1))); + return (float) Math.toDegrees(spatial.getLocalRotation().toAngleAxis(new Vector3f(0, 0, 1))); } /** @@ -87,11 +87,11 @@ public float getRotation() { * * @param rot The rotation in degrees to set. */ - public void setRotation(float rot){ - if(rot < 0) rot =- 360; + public void setRotation(float rot) { + if (rot < 0) rot = -360; Quaternion quaternion = new Quaternion(); - quaternion.fromAngleAxis((float) Math.toRadians(rot), new Vector3f(0,0,1)); + quaternion.fromAngleAxis((float) Math.toRadians(rot), new Vector3f(0, 0, 1)); spatial.setLocalRotation(quaternion); } @@ -100,7 +100,7 @@ public void setRotation(float rot){ * * @return The location of the piece as a {@link Vector3f}. */ - public Vector3f getLocation(){ + public Vector3f getLocation() { return spatial.getLocalTranslation(); } @@ -111,9 +111,9 @@ public Vector3f getLocation(){ */ @Override protected void controlUpdate(float delta) { - if(shieldRing != null){ + if (shieldRing != null) { shieldRing.rotate(0, 0, delta * SHIELD_SPEED); - shieldRing.setLocalTranslation(spatial.getLocalTranslation().add(new Vector3f(0,0,SHIELD_Z))); + shieldRing.setLocalTranslation(spatial.getLocalTranslation().add(new Vector3f(0, 0, SHIELD_Z))); } } @@ -122,7 +122,7 @@ protected void controlUpdate(float delta) { * * @param loc The location to set as a {@link Vector3f}. */ - public void setLocation(Vector3f loc){ + public void setLocation(Vector3f loc) { this.spatial.setLocalTranslation(loc); } @@ -131,7 +131,7 @@ public void setLocation(Vector3f loc){ * This also moves the spatial to a new parent node for organizational purposes. */ @Override - public void initSpatial(){ + public void initSpatial() { setRotation(this.initRotation); Node oldParent = spatial.getParent(); @@ -149,14 +149,14 @@ public void rotateInit() { * Activates the shield around the piece. * This adds a visual shield effect in the form of a rotating ring. */ - public void activateShield(){ - if(shieldRing != null){ + public void activateShield() { + if (shieldRing != null) { deactivateShield(); } shieldRing = assetManager.loadModel(Asset.shieldRing.getModelPath()); shieldRing.scale(1f); shieldRing.rotate((float) Math.toRadians(0), 0, (float) Math.toRadians(0)); - shieldRing.setLocalTranslation(spatial.getLocalTranslation().add(new Vector3f(0,0,SHIELD_Z))); + shieldRing.setLocalTranslation(spatial.getLocalTranslation().add(new Vector3f(0, 0, SHIELD_Z))); shieldRing.setQueueBucket(RenderQueue.Bucket.Transparent); // Render in the transparent bucket @@ -170,7 +170,7 @@ public void activateShield(){ * Deactivates the shield by removing the shield ring from the scene. */ - public void deactivateShield(){ + public void deactivateShield() { parentNode.detachChild(shieldRing); shieldRing = null; } @@ -178,16 +178,16 @@ public void deactivateShield(){ /** * Suppresses the shield, changing its color to a suppressed state. */ - public void suppressShield(){ - assert(shieldRing != null) : "PieceControl: shieldRing is not set"; + public void suppressShield() { + assert (shieldRing != null) : "PieceControl: shieldRing is not set"; shieldMat.setColor("Color", SHIELD_SUPPRESSED_COLOR); } - public void setMaterial(Material mat){ + public void setMaterial(Material mat) { spatial.setMaterial(mat); } - public Material getMaterial(){ + public Material getMaterial() { return ((Geometry) getSpatial()).getMaterial(); } @@ -205,7 +205,7 @@ public void highlight(boolean enemy) { /** * Removes the highlight effect from the piece. */ - public void unHighlight(){ + public void unHighlight() { highlight = false; deOutline(); } @@ -213,19 +213,19 @@ public void unHighlight(){ /** * Applies a hover effect on the piece if it is hoverable. */ - public void hover(){ - if(!hoverable) return; + public void hover() { + if (!hoverable) return; super.outline(enemy ? OUTLINE_ENEMY_HOVER_COLOR : OUTLINE_OWN_HOVER_COLOR, OUTLINE_HOVER_WIDTH); } /** * Removes the hover effect from the piece. */ - public void hoverOff(){ - if(!hoverable) return; + public void hoverOff() { + if (!hoverable) return; - if(select) select(); - else if(highlight) highlight(enemy); + if (select) select(); + else if (highlight) highlight(enemy); else deOutline(); } @@ -233,9 +233,9 @@ public void hoverOff(){ * Deselects the piece and removes the selection outline. If the piece was highlighted, * it will be re-highlighted. Otherwise, the outline is removed. */ - public void unSelect(){ + public void unSelect() { select = false; - if(highlight) highlight(enemy); + if (highlight) highlight(enemy); else deOutline(); } @@ -243,8 +243,8 @@ public void unSelect(){ * Selects the piece and applies the selection outline. If the piece is an enemy, it will * be outlined with the enemy selection color; otherwise, the own selection color will be used. */ - public void select(){ - if(!selectable) return; + public void select() { + if (!selectable) return; select = true; super.outline(enemy ? OUTLINE_ENEMY_SELECT_COLOR : OUTLINE_OWN_SELECT_COLOR, OUTLINE_SELECT_WIDTH); } @@ -254,7 +254,7 @@ public void select(){ * * @param selectable True if the piece can be selected, false otherwise. */ - public void setSelectable(boolean selectable){ + public void setSelectable(boolean selectable) { this.selectable = selectable; } @@ -263,7 +263,9 @@ public void setSelectable(boolean selectable){ * * @return True if the piece is selected, false otherwise. */ - public boolean isSelected() { return select; } + public boolean isSelected() { + return select; + } /** * Checks if the piece is selectable. diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/TankTopControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/TankTopControl.java index d6dbb128..aeb4c0a7 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/TankTopControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/TankTopControl.java @@ -37,9 +37,9 @@ protected void controlUpdate(float tpf) { // Apply the interpolated rotation to the spatial spatial.setLocalRotation(interpolatedRotation); - if(t >= 1){ + if (t >= 1) { rotating = false; - if(actionAfter != null) actionAfter.run(); + if (actionAfter != null) actionAfter.run(); } } @@ -62,7 +62,7 @@ public void rotate(Vector3f enemyPos, Runnable actionAfter) { this.actionAfter = actionAfter; // Store the action to execute after rotation } - private float getEnemyAngle(Vector3f enemyPos){ + private float getEnemyAngle(Vector3f enemyPos) { // Direction to the enemy in the XY plane Vector3f direction = enemyPos.subtract(spatial.getLocalTranslation()); direction.z = 0; // Project to XY plane diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/AbstractButton.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/AbstractButton.java index 96cf49f6..c9c94f86 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/AbstractButton.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/AbstractButton.java @@ -115,7 +115,7 @@ public abstract class AbstractButton { * Constructs an AbstractButton instance with the specified application context and scene node. * Initializes the button's visual elements and font. * - * @param app the application instance for accessing resources + * @param app the application instance for accessing resources * @param node the node in the scene graph to which the button is attached */ public AbstractButton(MdgaApp app, Node node) { diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/ButtonLeft.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/ButtonLeft.java index 9525d611..108f6629 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/ButtonLeft.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/ButtonLeft.java @@ -3,7 +3,6 @@ import com.jme3.math.Vector2f; import com.jme3.scene.Node; import pp.mdga.client.MdgaApp; -import com.jme3.ui.Picture; /** * Represents a specific implementation of a clickable button positioned on the left side. diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/CeremonyButton.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/CeremonyButton.java index 2402ba01..cf0cfb13 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/CeremonyButton.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/CeremonyButton.java @@ -69,15 +69,16 @@ public enum Pos { * Constructs a CeremonyButton with specified attributes such as type, position, and label. * The button supports both 2D and 3D components for UI and visual effects. * - * @param app the application instance for accessing resources and settings - * @param node the node in the scene graph to which the button belongs + * @param app the application instance for accessing resources and settings + * @param node the node in the scene graph to which the button belongs * @param node3d the node for 3D scene components associated with this button - * @param tsk the type/color associated with the button - * @param pos the position of the button in the ceremony layout - * @param name the label or name displayed on the button + * @param tsk the type/color associated with the button + * @param pos the position of the button in the ceremony layout + * @param name the label or name displayed on the button */ public CeremonyButton(MdgaApp app, Node node, Node node3d, Color tsk, Pos pos, String name) { - super(app, node, () -> {}, "", new Vector2f(WIDTH, 7), new Vector2f(0, 0)); + super(app, node, () -> { + }, "", new Vector2f(WIDTH, 7), new Vector2f(0, 0)); this.node3d = node3d; @@ -217,9 +218,9 @@ public void update(float tpf) { } model.setLocalRotation(new Quaternion().fromAngles( - (float) Math.toRadians(90), - (float) Math.toRadians(rot), - (float) Math.toRadians(180) + (float) Math.toRadians(90), + (float) Math.toRadians(rot), + (float) Math.toRadians(180) )); } @@ -236,9 +237,9 @@ private void createModel(Asset asset, Vector3f pos) { model = app.getAssetManager().loadModel(modelName); model.scale(asset.getSize() / 2); model.rotate( - (float) Math.toRadians(90), - (float) Math.toRadians(rot), - (float) Math.toRadians(180) + (float) Math.toRadians(90), + (float) Math.toRadians(rot), + (float) Math.toRadians(180) ); model.setShadowMode(RenderQueue.ShadowMode.CastAndReceive); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/ClickButton.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/ClickButton.java index ac375321..cc8d340c 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/ClickButton.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/ClickButton.java @@ -41,12 +41,12 @@ public abstract class ClickButton extends AbstractButton { /** * Constructs a ClickButton with the specified properties. * - * @param app the application instance for accessing resources - * @param node the node in the scene graph to which the button belongs + * @param app the application instance for accessing resources + * @param node the node in the scene graph to which the button belongs * @param action the action to execute on button click - * @param label the text label displayed on the button - * @param size the size of the button - * @param pos the position of the button in relative units + * @param label the text label displayed on the button + * @param size the size of the button + * @param pos the position of the button in relative units */ ClickButton(MdgaApp app, Node node, Runnable action, String label, Vector2f size, Vector2f pos) { super(app, node); @@ -203,9 +203,9 @@ protected void setImageRelative(Picture picture) { picture.setHeight(instance.getPreferredSize().y + larger); picture.setLocalTranslation( - instance.getLocalTranslation().x - larger / 2, - (instance.getLocalTranslation().y - picture.getHeight()) + larger / 2, - instance.getLocalTranslation().z + 0.01f + instance.getLocalTranslation().x - larger / 2, + (instance.getLocalTranslation().y - picture.getHeight()) + larger / 2, + instance.getLocalTranslation().z + 0.01f ); } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/LabelButton.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/LabelButton.java index dbb39da5..9424d319 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/LabelButton.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/LabelButton.java @@ -38,7 +38,8 @@ public class LabelButton extends ClickButton { * @param isButton whether this component acts as a button or a simple label */ public LabelButton(MdgaApp app, Node node, String label, Vector2f size, Vector2f pos, boolean isButton) { - super(app, node, () -> {}, label, size, pos); + super(app, node, () -> { + }, label, size, pos); this.isButton = isButton; diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/LobbyButton.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/LobbyButton.java index 2d6e4a13..2a8614f6 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/LobbyButton.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/LobbyButton.java @@ -1,17 +1,13 @@ package pp.mdga.client.button; -import com.jme3.light.AmbientLight; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; import com.jme3.math.Quaternion; import com.jme3.math.Vector2f; import com.jme3.math.Vector3f; import com.jme3.renderer.queue.RenderQueue; -import com.jme3.scene.Geometry; import com.jme3.scene.Node; import com.jme3.scene.Spatial; -import com.jme3.scene.shape.Quad; -import com.jme3.texture.Texture; import com.simsilica.lemur.component.QuadBackgroundComponent; import pp.mdga.client.Asset; import pp.mdga.client.MdgaApp; @@ -101,11 +97,11 @@ public enum Taken { /** * Constructs a LobbyButton with specified properties, including a 3D model and label. * - * @param app the application instance for accessing resources - * @param node the node in the scene graph to which the button belongs - * @param node3d the node for 3D scene components associated with this button - * @param action the action to execute when the button is clicked - * @param tsk the type or category of the button (e.g., CYBER, AIRFORCE) + * @param app the application instance for accessing resources + * @param node the node in the scene graph to which the button belongs + * @param node3d the node for 3D scene components associated with this button + * @param action the action to execute when the button is clicked + * @param tsk the type or category of the button (e.g., CYBER, AIRFORCE) */ public LobbyButton(MdgaApp app, Node node, Node node3d, Runnable action, Color tsk) { super(app, node, action, "", new Vector2f(WIDTH, 7), new Vector2f(0, 0)); @@ -261,9 +257,9 @@ public void update(float tpf) { } model.setLocalRotation(new Quaternion().fromAngles( - (float) Math.toRadians(90), - (float) Math.toRadians(rot), - (float) Math.toRadians(180) + (float) Math.toRadians(90), + (float) Math.toRadians(rot), + (float) Math.toRadians(180) )); } @@ -280,9 +276,9 @@ private void createModel(Asset asset, Vector3f pos) { model = app.getAssetManager().loadModel(modelName); model.scale(asset.getSize() / 2); model.rotate( - (float) Math.toRadians(90), - (float) Math.toRadians(rot), - (float) Math.toRadians(180) + (float) Math.toRadians(90), + (float) Math.toRadians(rot), + (float) Math.toRadians(180) ); model.setShadowMode(RenderQueue.ShadowMode.CastAndReceive); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/MenuButton.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/MenuButton.java index a66e43fd..6de2d952 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/MenuButton.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/MenuButton.java @@ -13,10 +13,10 @@ public class MenuButton extends ClickButton { /** * Constructs a MenuButton with specified properties. * - * @param app the application instance for accessing resources - * @param node the node in the scene graph to which the button belongs - * @param action the action to execute when the button is clicked - * @param label the text label displayed on the button + * @param app the application instance for accessing resources + * @param node the node in the scene graph to which the button belongs + * @param action the action to execute when the button is clicked + * @param label the text label displayed on the button */ public MenuButton(MdgaApp app, Node node, Runnable action, String label) { super(app, node, action, label, new Vector2f(5.5f, 2), new Vector2f(0, 0)); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/SettingsButton.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/SettingsButton.java index 6c56fb4f..cfb6c006 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/button/SettingsButton.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/button/SettingsButton.java @@ -2,8 +2,6 @@ import com.jme3.math.Vector2f; import com.jme3.scene.Node; -import com.simsilica.lemur.HAlignment; -import com.simsilica.lemur.VAlignment; import com.simsilica.lemur.component.IconComponent; import pp.mdga.client.MdgaApp; diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/AudioSettingsDialog.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/AudioSettingsDialog.java index 0e8ed643..6d60e8ee 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/AudioSettingsDialog.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/AudioSettingsDialog.java @@ -91,7 +91,7 @@ protected void onHide() { * This method is called continuously while the dialog is active. */ public void update() { - if(!active) { + if (!active) { return; } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/CeremonyDialog.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/CeremonyDialog.java index fd688bc3..32bff410 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/CeremonyDialog.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/CeremonyDialog.java @@ -88,7 +88,7 @@ public void addStatisticsRow(String name, int v1, int v2, int v3, int v4, int v5 int j = 0; for (LabelButton b : row) { - if(j > 0) { + if (j > 0) { b.setColor(colorText, colorButton); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/Dialog.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/Dialog.java index d6e25481..d61a56e5 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/Dialog.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/Dialog.java @@ -1,7 +1,6 @@ package pp.mdga.client.dialog; import com.jme3.scene.Node; -import com.simsilica.lemur.Container; import pp.mdga.client.MdgaApp; /** diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/HostDialog.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/HostDialog.java index f09f9d80..ed9f4194 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/HostDialog.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/HostDialog.java @@ -16,7 +16,7 @@ * The {@code HostDialog} class represents a dialog for hosting a network game session. * It allows users to input a port number, start hosting a server, and navigate back to the previous view. */ -public class HostDialog extends NetworkDialog { +public class HostDialog extends NetworkDialog { private InputButton portInput; private ButtonRight hostButton; diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/InterruptDialog.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/InterruptDialog.java index 201ac65f..99e8cff3 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/InterruptDialog.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/InterruptDialog.java @@ -3,11 +3,9 @@ import com.jme3.math.Vector2f; import com.jme3.scene.Node; import pp.mdga.client.MdgaApp; -import pp.mdga.client.button.AbstractButton; import pp.mdga.client.button.ButtonRight; import pp.mdga.client.button.LabelButton; import pp.mdga.client.button.MenuButton; -import pp.mdga.client.view.MdgaView; import pp.mdga.game.Color; /** @@ -39,7 +37,7 @@ public InterruptDialog(MdgaApp app, Node node) { @Override protected void onShow() { - if(app.getGameLogic().isHost()) { + if (app.getGameLogic().isHost()) { forceButton.show(); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/JoinDialog.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/JoinDialog.java index 5a1657a0..ad0cb571 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/JoinDialog.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/JoinDialog.java @@ -4,7 +4,6 @@ import com.jme3.scene.Node; import pp.mdga.client.MdgaApp; import pp.mdga.client.NetworkSupport; -import pp.mdga.client.acoustic.AcousticHandler; import pp.mdga.client.button.ButtonLeft; import pp.mdga.client.button.ButtonRight; import pp.mdga.client.button.InputButton; diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/NetworkDialog.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/NetworkDialog.java index c3d204c9..6597435d 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/NetworkDialog.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/NetworkDialog.java @@ -25,9 +25,9 @@ public abstract class NetworkDialog extends Dialog { /** * Constructs a {@code NetworkDialog}. * - * @param app The main application managing the dialog. - * @param node The root node for attaching UI elements. - * @param network The network support instance for managing network interactions. + * @param app The main application managing the dialog. + * @param node The root node for attaching UI elements. + * @param network The network support instance for managing network interactions. */ public NetworkDialog(MdgaApp app, Node node, NetworkSupport network) { super(app, node); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/SettingsDialog.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/SettingsDialog.java index 16aab847..6ff8960e 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/SettingsDialog.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/SettingsDialog.java @@ -3,9 +3,7 @@ import com.jme3.math.Vector2f; import com.jme3.scene.Node; import pp.mdga.client.MdgaApp; -import pp.mdga.client.button.InputButton; import pp.mdga.client.button.MenuButton; -import pp.mdga.client.view.MainView; import pp.mdga.client.view.MdgaView; /** diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/StartDialog.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/StartDialog.java index 14b61e65..2028e40c 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/StartDialog.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/StartDialog.java @@ -1,18 +1,13 @@ package pp.mdga.client.dialog; -import com.jme3.math.ColorRGBA; import com.jme3.math.Vector2f; -import com.jme3.math.Vector3f; import com.jme3.scene.Node; -import com.simsilica.lemur.Container; -import com.simsilica.lemur.component.QuadBackgroundComponent; import pp.mdga.client.MdgaApp; import pp.mdga.client.button.InputButton; import pp.mdga.client.button.MenuButton; import pp.mdga.client.view.MainView; import java.util.Random; -import java.util.random.RandomGenerator; /** * The {@code StartDialog} class represents the initial dialog in the application, @@ -75,8 +70,7 @@ protected void onShow() { * Called when the dialog is hidden. Hides the name input field and all buttons. */ @Override - protected void onHide () - { + protected void onHide() { nameInput.hide(); hostButton.hide(); @@ -101,210 +95,210 @@ public String getName() { if (name == null || name.trim().isEmpty()) { String[] names = { - "PixelPirat", - "NoobJäger", - "LagMeister", - "KnopfDrücker", - "SpawnCamper", - "AFKHeld", - "RageQuitter", - "GameOverPro", - "Checkpoint", - "RespawnHeld", - "Teebeutel", - "GlitchHexer", - "QuickScope", - "LootSammler", - "EpicLauch", - "KartoffelPro", - "StilleKlinge", - "TastenHeld", - "PixelKrieger", - "HacknSlash", - "JoystickJoe", - "SpawnFalle", - "OneHitWanda", - "CamperKing", - "GameGenie", - "HighPing", - "CheesePro", - "Speedy", - "GigaGamer", - "LevelNoob", - "SkillTobi", - "HeadshotMax", - "PentaPaul", - "CritKarl", - "ManaLeerer", - "Nachlader", - "ClutchKönig", - "FriendlyFe", - "ZonenHeld", - "SchleichKatze", - "ShotgunPro", - "SniperUdo", - "BossHunter", - "HeldenNoob", - "KillFranz", - "FragKarl", - "TeamNiete", - "LootPaul", - "UltraNoob", - "ProfiScout", - "PunkteKlaus", - "KrüppelKill", - "PixelNinja", - "NoobCrusher", - "LagBoss", - "SpawnKing", - "AFKSlayer", - "RespawnPro", - "Killjoy", - "GameBreaker", - "FastFingers", - "LootKing", - "QuickFlick", - "SilentShot", - "HackGod", - "GlitchHero", - "SpeedyBot", - "AimWizard", - "FragMaster", - "OneTapPro", - "KnifeLord", - "MetaHunter", - "PingWarrior", - "KeyBash", - "ClutchPro", - "ScopeBot", - "TrollMage", - "PowerLooter", - "TankHero", - "CampLord", - "SmurfSlayer", - "SkillThief", - "SniperGod", - "LevelHack", - "GhostAim", - "BossTamer", - "ShotgunJoe", - "AimRider", - "KillCount", - "PixelManiac", - "TrollOver", - "SneakPro", - "ReloadKing", - "SpawnTrap", - "LagLover", - "MetaHater", - "BoomMaker", - "WipeLord", - "CarryPro", - "ProBaiter", - "GameWarden", - "KartoffelKönig", - "SaufenderWolf", - "WurstGriller", - "Flitzekacke", - "BratwurstBub", - "Hoppeldoppels", - "BananenMensch", - "KlopapierGuru", - "SchnitzelKing", - "NerdNomade", - "Dönertänzer", - "GlitzerGurke", - "SchinkenShrek", - "KäseKalle", - "SchokoSchnecke", - "KeksKämpfer", - "QuarkPiraten", - "Müslimonster", - "KnuddelNase", - "FantaFighter", - "SchnapsSaurier", - "Wackelpudding", - "ZitronenZock", - "FettWurst", - "PlüschPanda", - "Zuckerschnur", - "FluffiKopf", - "DonutDöner", - "VollpfostenX", - "Waschlappen", - "Witzepumper", - "ToastTraum", - "FroschFighter", - "KrümelTiger", - "RegenWolke", - "PuddingPower", - "KoffeinKrieger", - "SpeckSchlumpf", - "SuperSuppe", - "BierBärchen", - "FischBär", - "Flauschi", - "Schokomonster", - "ChaosKäse", - "FlitzLappen", - "WurstWombat", - "KrümelMensch", - "PuddingBär", - "ZickZack", - "Schwabel", - "Fluffi", - "RülpsFrosch", - "PommesPapa", - "QuarkBär", - "KnusperKönig", - "ToastBrot", - "Ploppster", - "Schleimschwein", - "Äpfelchen", - "Knallbonbon", - "KaffeeKopf", - "WackelWurst", - "RennKeks", - "BröselBub", - "ZockerBrot", - "BierWurm", - "StinkFlummi", - "SchlumpfKing", - "PurzelBär", - "FlinkFluff", - "PloppPudel", - "Schnorchel", - "FliegenKopf", - "PixelPommes", - "SchwipsWürst", - "WutzBär", - "KnuddelKeks", - "FantaFlumm", - "ZockerKäse", - "LachHäufchen", - "GurkenGuru", - "PonySchnitzel", - "NudelNinja", - "VulkanKeks", - "WasserToast", - "MenschSalat", - "KampfKohl", - "SockenZirkus", - "SchwimmBärchen", - "TanzenderPudel", - "PizzamarktMensch", - "ZahnarztZocker", - "RollerRudi", - "PupsPilot", - "WitzigeZwiebel", - "Pillenschlucker", - "ZwiebelReiter", - "HüpfenderKaktus", - "AsteroidenAlf", - "ChaosKarotte", - "WolkenFurz", - "Krümelmonster", - "WackelBiene", + "PixelPirat", + "NoobJäger", + "LagMeister", + "KnopfDrücker", + "SpawnCamper", + "AFKHeld", + "RageQuitter", + "GameOverPro", + "Checkpoint", + "RespawnHeld", + "Teebeutel", + "GlitchHexer", + "QuickScope", + "LootSammler", + "EpicLauch", + "KartoffelPro", + "StilleKlinge", + "TastenHeld", + "PixelKrieger", + "HacknSlash", + "JoystickJoe", + "SpawnFalle", + "OneHitWanda", + "CamperKing", + "GameGenie", + "HighPing", + "CheesePro", + "Speedy", + "GigaGamer", + "LevelNoob", + "SkillTobi", + "HeadshotMax", + "PentaPaul", + "CritKarl", + "ManaLeerer", + "Nachlader", + "ClutchKönig", + "FriendlyFe", + "ZonenHeld", + "SchleichKatze", + "ShotgunPro", + "SniperUdo", + "BossHunter", + "HeldenNoob", + "KillFranz", + "FragKarl", + "TeamNiete", + "LootPaul", + "UltraNoob", + "ProfiScout", + "PunkteKlaus", + "KrüppelKill", + "PixelNinja", + "NoobCrusher", + "LagBoss", + "SpawnKing", + "AFKSlayer", + "RespawnPro", + "Killjoy", + "GameBreaker", + "FastFingers", + "LootKing", + "QuickFlick", + "SilentShot", + "HackGod", + "GlitchHero", + "SpeedyBot", + "AimWizard", + "FragMaster", + "OneTapPro", + "KnifeLord", + "MetaHunter", + "PingWarrior", + "KeyBash", + "ClutchPro", + "ScopeBot", + "TrollMage", + "PowerLooter", + "TankHero", + "CampLord", + "SmurfSlayer", + "SkillThief", + "SniperGod", + "LevelHack", + "GhostAim", + "BossTamer", + "ShotgunJoe", + "AimRider", + "KillCount", + "PixelManiac", + "TrollOver", + "SneakPro", + "ReloadKing", + "SpawnTrap", + "LagLover", + "MetaHater", + "BoomMaker", + "WipeLord", + "CarryPro", + "ProBaiter", + "GameWarden", + "KartoffelKönig", + "SaufenderWolf", + "WurstGriller", + "Flitzekacke", + "BratwurstBub", + "Hoppeldoppels", + "BananenMensch", + "KlopapierGuru", + "SchnitzelKing", + "NerdNomade", + "Dönertänzer", + "GlitzerGurke", + "SchinkenShrek", + "KäseKalle", + "SchokoSchnecke", + "KeksKämpfer", + "QuarkPiraten", + "Müslimonster", + "KnuddelNase", + "FantaFighter", + "SchnapsSaurier", + "Wackelpudding", + "ZitronenZock", + "FettWurst", + "PlüschPanda", + "Zuckerschnur", + "FluffiKopf", + "DonutDöner", + "VollpfostenX", + "Waschlappen", + "Witzepumper", + "ToastTraum", + "FroschFighter", + "KrümelTiger", + "RegenWolke", + "PuddingPower", + "KoffeinKrieger", + "SpeckSchlumpf", + "SuperSuppe", + "BierBärchen", + "FischBär", + "Flauschi", + "Schokomonster", + "ChaosKäse", + "FlitzLappen", + "WurstWombat", + "KrümelMensch", + "PuddingBär", + "ZickZack", + "Schwabel", + "Fluffi", + "RülpsFrosch", + "PommesPapa", + "QuarkBär", + "KnusperKönig", + "ToastBrot", + "Ploppster", + "Schleimschwein", + "Äpfelchen", + "Knallbonbon", + "KaffeeKopf", + "WackelWurst", + "RennKeks", + "BröselBub", + "ZockerBrot", + "BierWurm", + "StinkFlummi", + "SchlumpfKing", + "PurzelBär", + "FlinkFluff", + "PloppPudel", + "Schnorchel", + "FliegenKopf", + "PixelPommes", + "SchwipsWürst", + "WutzBär", + "KnuddelKeks", + "FantaFlumm", + "ZockerKäse", + "LachHäufchen", + "GurkenGuru", + "PonySchnitzel", + "NudelNinja", + "VulkanKeks", + "WasserToast", + "MenschSalat", + "KampfKohl", + "SockenZirkus", + "SchwimmBärchen", + "TanzenderPudel", + "PizzamarktMensch", + "ZahnarztZocker", + "RollerRudi", + "PupsPilot", + "WitzigeZwiebel", + "Pillenschlucker", + "ZwiebelReiter", + "HüpfenderKaktus", + "AsteroidenAlf", + "ChaosKarotte", + "WolkenFurz", + "Krümelmonster", + "WackelBiene", }; Random random = new Random(); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/VideoSettingsDialog.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/VideoSettingsDialog.java index bb7b767a..0b765659 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/VideoSettingsDialog.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/dialog/VideoSettingsDialog.java @@ -3,7 +3,6 @@ import com.jme3.math.Vector2f; import com.jme3.scene.Node; import pp.mdga.client.MdgaApp; -import pp.mdga.client.button.AbstractButton; import pp.mdga.client.button.ButtonLeft; import pp.mdga.client.button.ButtonRight; import pp.mdga.client.button.MenuButton; @@ -122,7 +121,7 @@ protected void onHide() { * Updates the dialog's state. This method can be used for periodic updates while the dialog is active. */ public void update() { - if(!active) { + if (!active) { return; } } @@ -130,13 +129,13 @@ public void update() { /** * Updates the resolution settings and optionally triggers the restart button if changes are detected. * - * @param width The width of the resolution. - * @param height The height of the resolution. - * @param imageFactor The scaling factor for the resolution. - * @param isFullscreen {@code true} if fullscreen mode is enabled, {@code false} otherwise. + * @param width The width of the resolution. + * @param height The height of the resolution. + * @param imageFactor The scaling factor for the resolution. + * @param isFullscreen {@code true} if fullscreen mode is enabled, {@code false} otherwise. */ public void updateResolution(int width, int height, float imageFactor, boolean isFullscreen) { - if(width != prefs.getInt("width", 1280) || height != prefs.getInt("height", 720) || isFullscreen != prefs.getBoolean("fullscreen", false)) { + if (width != prefs.getInt("width", 1280) || height != prefs.getInt("height", 720) || isFullscreen != prefs.getBoolean("fullscreen", false)) { restartButton.show(); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/ActionTextHandler.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/ActionTextHandler.java index b769a2b7..b958182a 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/ActionTextHandler.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/ActionTextHandler.java @@ -14,7 +14,7 @@ * The {@code ActionTextHandler} class manages the display of animated and stylized text messages in the game's UI. * It supports dynamic text creation with spacing, color, and effects, such as dice rolls, player actions, and rankings. */ - class ActionTextHandler { +class ActionTextHandler { private Node root; private BitmapFont font; private AppSettings appSettings; @@ -29,7 +29,7 @@ class ActionTextHandler { * @param assetManager The asset manager used to load fonts and other assets. * @param appSettings The application settings for positioning and sizing. */ - ActionTextHandler(Node guiNode, AssetManager assetManager, AppSettings appSettings){ + ActionTextHandler(Node guiNode, AssetManager assetManager, AppSettings appSettings) { root = new Node("actionTextRoot"); guiNode.attachChild(root); @@ -50,12 +50,12 @@ class ActionTextHandler { * @throws RuntimeException if the lengths of {@code textArr} and {@code colorArr} do not match. */ private Node createTextWithSpacing(String[] textArr, float spacing, float size, ColorRGBA[] colorArr) { - if(textArr.length != colorArr.length) throw new RuntimeException("text and color are not the same length"); + if (textArr.length != colorArr.length) throw new RuntimeException("text and color are not the same length"); Node textNode = new Node("TextWithSpacing"); Node center = new Node(); float xOffset = 0; - for(int i = 0; i < textArr.length; i++){ + for (int i = 0; i < textArr.length; i++) { String text = textArr[i]; ColorRGBA color = colorArr[i]; for (char c : text.toCharArray()) { @@ -63,14 +63,14 @@ private Node createTextWithSpacing(String[] textArr, float spacing, float size, letter.setColor(color); letter.setSize(size); letter.setText(Character.toString(c)); - letter.setLocalTranslation(xOffset, letter.getHeight()/2, 0); + letter.setLocalTranslation(xOffset, letter.getHeight() / 2, 0); center.attachChild(letter); xOffset += letter.getLineWidth() + spacing; } } - center.setLocalTranslation(new Vector3f(-xOffset/2,0,0)); + center.setLocalTranslation(new Vector3f(-xOffset / 2, 0, 0)); textNode.attachChild(center); return textNode; } @@ -96,8 +96,8 @@ private Node createTextWithSpacing(String text, float spacing, float size, Color * @param pos The origin position of the rectangle. * @return A {@code Vector3f} representing the center position. */ - private Vector3f center(float width, float height, Vector3f pos){ - return new Vector3f(pos.x+width/2, pos.y+height/2,0); + private Vector3f center(float width, float height, Vector3f pos) { + return new Vector3f(pos.x + width / 2, pos.y + height / 2, 0); } /** @@ -110,7 +110,7 @@ private Vector3f center(float width, float height, Vector3f pos){ * @param top The vertical offset from the top of the screen. * @return A {@code Node} containing the styled text positioned at the top. */ - private Node createTopText(String name, float spacing, float size, ColorRGBA color, float top){ + private Node createTopText(String name, float spacing, float size, ColorRGBA color, float top) { return createTopText(new String[]{name}, spacing, size, new ColorRGBA[]{color}, top); } @@ -124,9 +124,9 @@ private Node createTopText(String name, float spacing, float size, ColorRGBA col * @param top The vertical offset from the top of the screen. * @return A {@code Node} containing the styled text positioned at the top. */ - private Node createTopText(String[] name, float spacing, float size, ColorRGBA color[], float top){ + private Node createTopText(String[] name, float spacing, float size, ColorRGBA color[], float top) { Node text = createTextWithSpacing(name, spacing, size, color); - text.setLocalTranslation(0, (appSettings.getHeight()/2f)*0.8f-top,0); + text.setLocalTranslation(0, (appSettings.getHeight() / 2f) * 0.8f - top, 0); root.attachChild(text); return text; } @@ -139,7 +139,7 @@ private Node createTopText(String[] name, float spacing, float size, ColorRGBA c * @param pos The origin position of the rectangle. * @return A {@code Vector3f} representing the center position. */ - private Vector3f centerText(float width, float height, Vector3f pos){ + private Vector3f centerText(float width, float height, Vector3f pos) { return center(-width, height, pos); } @@ -149,8 +149,8 @@ private Vector3f centerText(float width, float height, Vector3f pos){ * @param name The name of the active player. * @param color The color representing the player's team. */ - void activePlayer(String name, Color color){ - createTopText(new String[]{name," ist dran"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl()); + void activePlayer(String name, Color color) { + createTopText(new String[]{name, " ist dran"}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl()); } /** @@ -158,8 +158,8 @@ void activePlayer(String name, Color color){ * * @param color The color representing the player's team. */ - void ownActive(Color color){ - createTopText(new String[]{"Du"," bist dran"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl()); + void ownActive(Color color) { + createTopText(new String[]{"Du", " bist dran"}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl()); } /** @@ -169,8 +169,8 @@ void ownActive(Color color){ * @param name The name of the player. * @param color The color representing the player's team. */ - void diceNum(int diceNum, String name, Color color){ - createTopText(new String[]{name," würfelt:"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0); + void diceNum(int diceNum, String name, Color color) { + createTopText(new String[]{name, " würfelt:"}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0); createTopText(String.valueOf(diceNum), 10, 100, ColorRGBA.White, 100); @@ -184,10 +184,10 @@ void diceNum(int diceNum, String name, Color color){ * @param name The name of the player. * @param color The color representing the player's team. */ - void diceNumMult(int diceNum,int mult, String name, Color color){ - createTopText(new String[]{name," würfelt:"}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0); + void diceNumMult(int diceNum, int mult, String name, Color color) { + createTopText(new String[]{name, " würfelt:"}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0); - createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum*mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White,ColorRGBA.Red}, 100); + createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum * mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White, ColorRGBA.Red}, 100); } /** @@ -195,7 +195,7 @@ void diceNumMult(int diceNum,int mult, String name, Color color){ * * @param diceNum The number rolled on the dice. */ - void ownDice(int diceNum){ + void ownDice(int diceNum) { createTopText(String.valueOf(diceNum), 10, 100, ColorRGBA.White, 0); } @@ -205,8 +205,8 @@ void ownDice(int diceNum){ * @param diceNum The number rolled on the dice. * @param mult The multiplier applied to the dice result. */ - void ownDiceMult(int diceNum, int mult){ - createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum*mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White,ColorRGBA.Red}, 0); + void ownDiceMult(int diceNum, int mult) { + createTopText(new String[]{String.valueOf(diceNum), " x" + mult + " = " + (diceNum * mult)}, 20, 100, new ColorRGBA[]{ColorRGBA.White, ColorRGBA.Red}, 0); } /** @@ -215,8 +215,8 @@ void ownDiceMult(int diceNum, int mult){ * @param name The name of the player who received the bonus card. * @param color The color representing the player's team. */ - void drawCard(String name, Color color){ - createTopText(new String[]{name," erhält eine Bonuskarte"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl()); + void drawCard(String name, Color color) { + createTopText(new String[]{name, " erhält eine Bonuskarte"}, 7, 70, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl()); } /** @@ -224,8 +224,8 @@ void drawCard(String name, Color color){ * * @param color The color representing the player's team. */ - void drawCardOwn(Color color){ - createTopText(new String[]{"Du"," erhälst eine Bonuskarte"}, 5,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl()); + void drawCardOwn(Color color) { + createTopText(new String[]{"Du", " erhälst eine Bonuskarte"}, 5, 70, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl()); } /** @@ -234,8 +234,8 @@ void drawCardOwn(Color color){ * @param name The name of the player who finished. * @param color The color representing the player's team. */ - void finishText(String name, Color color){ - createTopText(new String[]{name," ist fertig!"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl()); + void finishText(String name, Color color) { + createTopText(new String[]{name, " ist fertig!"}, 7, 70, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl()); } /** @@ -243,8 +243,8 @@ void finishText(String name, Color color){ * * @param color The color representing the player's team. */ - void finishTextOwn(Color color){ - createTopText(new String[]{"Du", " bist fertig!"}, 7,70, new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, 0).addControl(new ZoomControl()); + void finishTextOwn(Color color) { + createTopText(new String[]{"Du", " bist fertig!"}, 7, 70, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, 0).addControl(new ZoomControl()); } /** @@ -254,8 +254,8 @@ void finishTextOwn(Color color){ * @return The corresponding {@code ColorRGBA}. * @throws RuntimeException if the color is invalid. */ - private ColorRGBA playerColorToColorRGBA(Color color){ - return switch (color){ + private ColorRGBA playerColorToColorRGBA(Color color) { + return switch (color) { case ARMY -> ColorRGBA.Green; case NAVY -> ColorRGBA.Blue; case CYBER -> ColorRGBA.Orange; @@ -267,9 +267,9 @@ private ColorRGBA playerColorToColorRGBA(Color color){ /** * Hides all text messages displayed by the handler and resets the ranking counter. */ - void hide(){ - ranking = 0; - root.detachAllChildren(); + void hide() { + ranking = 0; + root.detachAllChildren(); } /** @@ -279,8 +279,8 @@ void hide(){ * @param color The color representing the player's team. * @param eye The dice roll result. */ - void rollRankingResult(String name, Color color, int eye){ - createTopText(new String[]{name,": "+eye}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, paddingRanked*ranking); + void rollRankingResult(String name, Color color, int eye) { + createTopText(new String[]{name, ": " + eye}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, paddingRanked * ranking); ranking++; } @@ -290,15 +290,15 @@ void rollRankingResult(String name, Color color, int eye){ * @param color The color representing the player's team. * @param eye The dice roll result. */ - void rollRankingResultOwn(Color color, int eye){ - createTopText(new String[]{"Du",": "+eye}, 10,90,new ColorRGBA[]{playerColorToColorRGBA(color),ColorRGBA.White}, paddingRanked*ranking); - ranking++; - } + void rollRankingResultOwn(Color color, int eye) { + createTopText(new String[]{"Du", ": " + eye}, 10, 90, new ColorRGBA[]{playerColorToColorRGBA(color), ColorRGBA.White}, paddingRanked * ranking); + ranking++; + } /** * Displays a message prompting the player to roll the dice. */ - void diceNow(){ - createTopText("Klicke zum Würfeln", 5, 80, ColorRGBA.White, 0); - } + void diceNow() { + createTopText("Klicke zum Würfeln", 5, 80, ColorRGBA.White, 0); + } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardControl.java index 46e47ee6..ab9d3647 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardControl.java @@ -7,19 +7,12 @@ import com.jme3.math.Vector3f; import com.jme3.post.FilterPostProcessor; import com.jme3.renderer.Camera; -import com.jme3.renderer.RenderManager; -import com.jme3.renderer.ViewPort; import com.jme3.scene.Geometry; import com.jme3.scene.Node; -import com.jme3.scene.control.AbstractControl; -import com.jme3.scene.shape.Box; -import com.jme3.scene.shape.Cylinder; import com.jme3.scene.shape.Sphere; import pp.mdga.client.MdgaApp; import pp.mdga.client.board.OutlineControl; -import java.awt.*; - public class CardControl extends OutlineControl { private static final ColorRGBA OUTLINE_COLOR = ColorRGBA.Yellow; @@ -42,20 +35,20 @@ public class CardControl extends OutlineControl { private Node root; private BitmapText num; - public CardControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, Node root){ + public CardControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, Node root) { super(app, fpp, cam, OUTLINE_THICKNESS); this.root = root; Node rootNum = createNum(); - rootNum.setLocalTranslation(new Vector3f(0.35f,0.8f,0)); + rootNum.setLocalTranslation(new Vector3f(0.35f, 0.8f, 0)); root.attachChild(rootNum); } - private Node createNum(){ + private Node createNum() { Node rootNum = new Node("root Num"); - Geometry circle = new Geometry("circle", new Sphere(20,20,1)); - circle.setLocalTranslation(new Vector3f(0.03f,0.01f,1)); + Geometry circle = new Geometry("circle", new Sphere(20, 20, 1)); + circle.setLocalTranslation(new Vector3f(0.03f, 0.01f, 1)); circle.setLocalScale(0.2f); Material mat = new Material(getApp().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); mat.setColor("Color", ColorRGBA.Black); @@ -72,7 +65,7 @@ private Node createNum(){ return rootNum; } - public void setNumCard(int num){ + public void setNumCard(int num) { this.num.setText(String.valueOf(num)); } @@ -81,14 +74,14 @@ public Node getRoot() { } @Override - public void initSpatial(){ + public void initSpatial() { } - public void outline(){ + public void outline() { super.outline(OUTLINE_COLOR); } - private final static Vector3f HIGHLIGHT_Y = new Vector3f(0,0.4f,0); + private final static Vector3f HIGHLIGHT_Y = new Vector3f(0, 0.4f, 0); public void setHighlight() { this.highlight = true; @@ -100,39 +93,39 @@ public void highlight() { super.outline(HIGHLIGHT_COLOR, HIGHLIGHT_WIDTH); } - public void unHighlight(){ + public void unHighlight() { highlight = false; root.setLocalTranslation(root.getLocalTranslation().subtract(HIGHLIGHT_Y)); deOutline(); } - public void hover(){ - if(!hoverable) return; + public void hover() { + if (!hoverable) return; super.outline(HOVER_COLOR, HOVER_WIDTH); } - public void hoverOff(){ - if(!hoverable) return; + public void hoverOff() { + if (!hoverable) return; - if(select) select(); - else if(highlight) highlight(); + if (select) select(); + else if (highlight) highlight(); else deOutline(); } - public void select(){ - if(!selectable) return; + public void select() { + if (!selectable) return; select = true; super.outline(SELECT_COLOR, SELECT_WIDTH); } - public void unSelect(){ - if(!selectable) return; + public void unSelect() { + if (!selectable) return; select = false; - if(highlight) highlight(); + if (highlight) highlight(); else deOutline(); } - public void setSelectable(boolean selectable){ + public void setSelectable(boolean selectable) { this.selectable = selectable; } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayer.java index ed68fd95..5797dd93 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayer.java @@ -19,7 +19,8 @@ import com.jme3.texture.Image; import com.jme3.texture.Texture2D; -import java.util.*; +import java.util.ArrayList; +import java.util.List; public class CardLayer extends AbstractAppState { @@ -115,7 +116,7 @@ public void update(float tpf) { } public void addSpatial(Spatial card) { - if(root == null) cardBuffer.add(card); + if (root == null) cardBuffer.add(card); else root.attachChild(card); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayerHandler.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayerHandler.java index eda19ab4..08c73781 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayerHandler.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayerHandler.java @@ -66,7 +66,7 @@ public void rollDice(int rollNum, Runnable actionAfter) { } public void showDice() { - if(show) return; + if (show) return; show = true; cardLayer.addSpatial(diceControl.getSpatial()); diceControl.spin(); @@ -90,11 +90,11 @@ public void addCard(BonusCard card) { updateCard(); } - public void removeCard(BonusCard card){ - if(bonusCardControlMap.containsKey(card)){ + public void removeCard(BonusCard card) { + if (bonusCardControlMap.containsKey(card)) { bonusCardIntegerMap.put(card, bonusCardIntegerMap.get(card) - 1); - if(bonusCardIntegerMap.get(card) <= 0){ + if (bonusCardIntegerMap.get(card) <= 0) { bonusCardIntegerMap.remove(card); cardOrder.remove(card); } @@ -113,14 +113,14 @@ public void clearSelectableCards() { cardSelect = null; } - private void updateCard(){ - for(BonusCard card : bonusCardControlMap.keySet()){ + private void updateCard() { + for (BonusCard card : bonusCardControlMap.keySet()) { CardControl control = bonusCardControlMap.get(card); cardLayer.deleteSpatial(control.getRoot()); } bonusCardControlMap.clear(); - for(int i = 0; i < cardOrder.size(); i++){ + for (int i = 0; i < cardOrder.size(); i++) { BonusCard card = cardOrder.get(i); CardControl control = createCard(bonusToAsset(card), nextPos(i)); control.setNumCard(bonusCardIntegerMap.get(card)); @@ -159,19 +159,19 @@ public Camera getCardLayerCamera() { return cardLayerCamera; } - public void shield(){ + public void shield() { SymbolControl control = createSymbol(Asset.shieldSymbol); cardLayer.addSpatial(control.getSpatial()); control.shield(); } - public void swap(){ + public void swap() { SymbolControl control = createSymbol(Asset.swapSymbol); cardLayer.addSpatial(control.getSpatial()); control.swap(); } - public void turbo(){ + public void turbo() { SymbolControl control = createSymbol(Asset.turboSymbol); cardLayer.addSpatial(control.getSpatial()); control.turbo(); @@ -218,7 +218,7 @@ public void test() { addCard(BonusCard.SWAP); } - private CardControl createCard(Asset card, Vector3f pos){ + private CardControl createCard(Asset card, Vector3f pos) { Node rootCard = new Node("Root Card"); Spatial spatial = app.getAssetManager().loadModel(card.getModelPath()); rootCard.attachChild(spatial); @@ -227,26 +227,26 @@ private CardControl createCard(Asset card, Vector3f pos){ spatial.setMaterial(mat); spatial.setLocalScale(1f); rootCard.setLocalTranslation(pos); - spatial.rotate((float)Math.toRadians(90), (float)Math.toRadians(180), (float)Math.toRadians(180)); + spatial.rotate((float) Math.toRadians(90), (float) Math.toRadians(180), (float) Math.toRadians(180)); spatial.setShadowMode(RenderQueue.ShadowMode.CastAndReceive); CardControl control = new CardControl(app, fpp, cardLayer.getOverlayCam(), rootCard); spatial.addControl(control); return control; } - private SymbolControl createSymbol(Asset asset){ + private SymbolControl createSymbol(Asset asset) { Spatial spatial = app.getAssetManager().loadModel(asset.getModelPath()); Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", app.getAssetManager().loadTexture(asset.getDiffPath())); spatial.setMaterial(mat); spatial.setLocalScale(1f); - spatial.rotate((float)Math.toRadians(90), (float)Math.toRadians(180), (float)Math.toRadians(180)); + spatial.rotate((float) Math.toRadians(90), (float) Math.toRadians(180), (float) Math.toRadians(180)); SymbolControl control = new SymbolControl(); spatial.addControl(control); return control; } - public CardLayer getCardLayer(){ + public CardLayer getCardLayer() { return cardLayer; } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/DiceControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/DiceControl.java index e90f20f5..10437a6a 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/DiceControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/DiceControl.java @@ -13,8 +13,6 @@ import pp.mdga.client.Asset; import pp.mdga.client.MdgaApp; -import java.util.Random; - import static com.jme3.material.Materials.LIGHTING; import static com.jme3.material.Materials.UNSHADED; @@ -33,7 +31,7 @@ public class DiceControl extends AbstractControl { private final AssetManager assetManager; private Runnable actionAfter; - public DiceControl(AssetManager assetManager){ + public DiceControl(AssetManager assetManager) { this.assetManager = assetManager; } @@ -42,7 +40,7 @@ public DiceControl(AssetManager assetManager){ protected void controlUpdate(float tpf) { float clampedTpf = Math.min(tpf, 0.05f); // Max 50 ms per frame if (isRolling) { - if(!slerp) { + if (!slerp) { // Apply rotational velocity to the dice spinWithAngularVelocity(clampedTpf); @@ -55,8 +53,7 @@ protected void controlUpdate(float tpf) { if (angularVelocity.lengthSquared() <= 3f || MdgaApp.DEBUG_MULTIPLIER == 0) { slerp = true; } - } - else { + } else { timeElapsed += clampedTpf * rollDuration; @@ -66,18 +63,18 @@ protected void controlUpdate(float tpf) { spatial.setLocalRotation(interpolated); // Stop rolling once duration is complete - if (timeElapsed >= 1.0f * MdgaApp.DEBUG_MULTIPLIER) { + if (timeElapsed >= 1.0f * MdgaApp.DEBUG_MULTIPLIER) { isRolling = false; slerp = false; actionAfter.run(); } } - } else if(spin){ + } else if (spin) { spinWithAngularVelocity(clampedTpf); } } - private void spinWithAngularVelocity(float tpf){ + private void spinWithAngularVelocity(float tpf) { Quaternion currentRotation = spatial.getLocalRotation(); Quaternion deltaRotation = new Quaternion(); deltaRotation.fromAngles( @@ -100,9 +97,9 @@ public void rollDice(int diceNum, Runnable actionAfter) { timeElapsed = 0; this.actionAfter = actionAfter; angularVelocity.set( - FastMath.nextRandomInt(ANGULAR_MIN,ANGULAR_MAX), - FastMath.nextRandomInt(ANGULAR_MIN,ANGULAR_MAX), - FastMath.nextRandomInt(ANGULAR_MIN,ANGULAR_MAX) + FastMath.nextRandomInt(ANGULAR_MIN, ANGULAR_MAX), + FastMath.nextRandomInt(ANGULAR_MIN, ANGULAR_MAX), + FastMath.nextRandomInt(ANGULAR_MIN, ANGULAR_MAX) ); targetRotation = getRotationForDiceNum(diceNum); @@ -136,38 +133,37 @@ public void randomRotation() { spatial.setLocalRotation(randomRotation); } - public void spin(){ - angularVelocity.set(ANGULAR_SPIN,ANGULAR_SPIN,ANGULAR_SPIN); + public void spin() { + angularVelocity.set(ANGULAR_SPIN, ANGULAR_SPIN, ANGULAR_SPIN); spin = true; } - public void hide(){ + public void hide() { spatial.removeFromParent(); spin = false; isRolling = false; slerp = false; } - public void create(Vector3f pos, float scale, boolean shadow){ + public void create(Vector3f pos, float scale, boolean shadow) { Spatial spatial = assetManager.loadModel(Asset.dice.getModelPath()); Material mat; - if(shadow){ + if (shadow) { mat = new Material(assetManager, LIGHTING); mat.setTexture("DiffuseMap", assetManager.loadTexture(Asset.dice.getDiffPath())); spatial.setShadowMode(RenderQueue.ShadowMode.CastAndReceive); - } - else{ + } else { mat = new Material(assetManager, UNSHADED); mat.setTexture("ColorMap", assetManager.loadTexture(Asset.dice.getDiffPath())); } spatial.setMaterial(mat); spatial.setLocalScale(scale); spatial.setLocalTranslation(pos); - spatial.rotate((float)Math.toRadians(90), (float)Math.toRadians(180), (float)Math.toRadians(180)); + spatial.rotate((float) Math.toRadians(90), (float) Math.toRadians(180), (float) Math.toRadians(180)); spatial.addControl(this); } - public void setPos(Vector3f pos){ + public void setPos(Vector3f pos) { spatial.setLocalTranslation(pos); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/GuiHandler.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/GuiHandler.java index d57a99f1..8b3c7b61 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/GuiHandler.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/GuiHandler.java @@ -6,8 +6,8 @@ import com.jme3.texture.Image; import com.jme3.texture.Texture2D; import pp.mdga.client.MdgaApp; -import pp.mdga.game.Color; import pp.mdga.game.BonusCard; +import pp.mdga.game.Color; import java.util.List; @@ -47,8 +47,8 @@ public void shutdown() { } public void rollDice(int rollNum, int mult) { - cardLayerHandler.rollDice(rollNum, ()->{ - if(mult == -1) actionTextHandler.ownDice(rollNum); + cardLayerHandler.rollDice(rollNum, () -> { + if (mult == -1) actionTextHandler.ownDice(rollNum); else actionTextHandler.ownDiceMult(rollNum, mult); hideDice(); app.getModelSynchronize().animationEnd(); @@ -58,7 +58,7 @@ public void rollDice(int rollNum, int mult) { public void showRolledDiceMult(int rollNum, int mult, Color color) { String name = playerNameHandler.getName(color); - if(mult == -1) actionTextHandler.diceNum(rollNum, name, color); + if (mult == -1) actionTextHandler.diceNum(rollNum, name, color); else actionTextHandler.diceNumMult(rollNum, mult, name, color); } @@ -82,7 +82,7 @@ public void addCardOwn(BonusCard card) { actionTextHandler.drawCardOwn(ownColor); } - public void playCardOwn(BonusCard card){ + public void playCardOwn(BonusCard card) { getEffectByCard(card); cardLayerHandler.removeCard(card); playerNameHandler.removeCard(ownColor); @@ -93,8 +93,8 @@ public void playCardEnemy(Color color, BonusCard card) { playerNameHandler.removeCard(color); } - private void getEffectByCard(BonusCard bonus){ - switch(bonus){ + private void getEffectByCard(BonusCard bonus) { + switch (bonus) { case SWAP -> swap(); case TURBO -> turbo(); case SHIELD -> shield(); @@ -118,7 +118,7 @@ public Camera getCardLayerCamera() { return cardLayerHandler.getCardLayerCamera(); } - public Node getCardLayerRootNode(){ + public Node getCardLayerRootNode() { return cardLayerHandler.getCardLayer().getRootNode(); } @@ -133,19 +133,19 @@ public void setActivePlayer(Color color) { else actionTextHandler.activePlayer(playerNameHandler.getName(color), color); } - public void shield(){ + public void shield() { cardLayerHandler.shield(); } - public void swap(){ + public void swap() { cardLayerHandler.swap(); } - public void turbo(){ + public void turbo() { cardLayerHandler.turbo(); } - public void hideText(){ + public void hideText() { actionTextHandler.hide(); } @@ -156,17 +156,15 @@ public void drawCard(Color color) { playerNameHandler.addCard(color); } - public void finish(Color color){ - if(ownColor == color) actionTextHandler.finishTextOwn(color); + public void finish(Color color) { + if (ownColor == color) actionTextHandler.finishTextOwn(color); else actionTextHandler.finishText(playerNameHandler.getName(color), color); } - public void rollRankingResult(Color color, int eye){ - if(ownColor == color) actionTextHandler.rollRankingResultOwn(color, eye); + public void rollRankingResult(Color color, int eye) { + if (ownColor == color) actionTextHandler.rollRankingResultOwn(color, eye); else actionTextHandler.rollRankingResult(playerNameHandler.getName(color), color, eye); } - - } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/PlayerNameHandler.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/PlayerNameHandler.java index 083319e6..841e1a07 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/PlayerNameHandler.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/PlayerNameHandler.java @@ -4,19 +4,16 @@ import com.jme3.font.BitmapFont; import com.jme3.font.BitmapText; import com.jme3.math.ColorRGBA; -import com.jme3.math.Vector3f; import com.jme3.scene.Node; import com.jme3.scene.Spatial; import com.jme3.system.AppSettings; import com.jme3.ui.Picture; -import pp.mdga.game.BonusCard; import pp.mdga.game.Color; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Vector; public class PlayerNameHandler { private final BitmapFont playerFont; @@ -40,7 +37,7 @@ public class PlayerNameHandler { private final Node guiNode; - public PlayerNameHandler(Node guiNode, AssetManager assetManager, AppSettings appSettings){ + public PlayerNameHandler(Node guiNode, AssetManager assetManager, AppSettings appSettings) { this.guiNode = guiNode; playerFont = assetManager.loadFont("Fonts/Gunplay.fnt"); @@ -60,35 +57,35 @@ public void hide() { guiNode.detachChild(playerNameNode); } - private void drawPlayers(){ + private void drawPlayers() { playerNameNode.detachAllChildren(); - for(int i = 0; i < playerOrder.size(); i++) { + for (int i = 0; i < playerOrder.size(); i++) { Color color = playerOrder.get(i); - if(!colorNameMap.containsKey(color)) throw new RuntimeException(color + " isn't mapped to a name"); + if (!colorNameMap.containsKey(color)) throw new RuntimeException(color + " isn't mapped to a name"); Node nameParent = new Node("nameParent"); nameParent.attachChild(createColor(color)); BitmapText name = createName(colorNameMap.get(color), i == 0, color == ownColor); nameParent.attachChild(name); - if(colorCardMap.getOrDefault(color, 0) > 0){ + if (colorCardMap.getOrDefault(color, 0) > 0) { Picture pic = createHandCard(name.getLineWidth()); nameParent.attachChild(pic); nameParent.attachChild(createCardNum(colorCardMap.get(color), pic.getWidth(), pic.getLocalTranslation().getX())); } - nameParent.setLocalTranslation(50,appSettings.getWindowHeight()-PADDING_TOP- MARGIN_NAMES *i,0); + nameParent.setLocalTranslation(50, appSettings.getWindowHeight() - PADDING_TOP - MARGIN_NAMES * i, 0); playerNameNode.attachChild(nameParent); } } - private Spatial createCardNum(int num, float lastWidth, float lastX ) { + private Spatial createCardNum(int num, float lastWidth, float lastX) { BitmapText hudText = new BitmapText(playerFont); //renderedSize = 45 hudText.setSize(TEXT_SIZE); hudText.setColor(NORMAL_COLOR); hudText.setText(String.valueOf(num)); - hudText.setLocalTranslation(lastX + lastWidth + 20,hudText.getHeight()/2, 0); + hudText.setLocalTranslation(lastX + lastWidth + 20, hudText.getHeight() / 2, 0); return hudText; } @@ -97,17 +94,17 @@ private Picture createHandCard(float width) { pic.setImage(assetManager, "./Images/handcard.png", true); pic.setWidth(IMAGE_SIZE); pic.setHeight(IMAGE_SIZE); - pic.setPosition(-pic.getWidth()/2 + width + PADDING_LEFT * 2 ,-pic.getHeight()/2); + pic.setPosition(-pic.getWidth() / 2 + width + PADDING_LEFT * 2, -pic.getHeight() / 2); return pic; } - private String imagePath(Color color){ + private String imagePath(Color color) { String root = "./Images/name_pictures/"; - return switch(color){ - case ARMY -> root+"HEER_IMAGE.png"; - case NAVY -> root+"MARINE_IMAGE.png"; - case CYBER -> root+"CIR_IMAGE.png"; - case AIRFORCE -> root+"LW_IMAGE.png"; + return switch (color) { + case ARMY -> root + "HEER_IMAGE.png"; + case NAVY -> root + "MARINE_IMAGE.png"; + case CYBER -> root + "CIR_IMAGE.png"; + case AIRFORCE -> root + "LW_IMAGE.png"; default -> throw new RuntimeException("None is not valid"); }; } @@ -117,31 +114,30 @@ private Spatial createColor(Color color) { pic.setImage(assetManager, imagePath(color), true); pic.setWidth(IMAGE_SIZE); pic.setHeight(IMAGE_SIZE); - pic.setPosition(-pic.getWidth()/2,-pic.getHeight()/2); + pic.setPosition(-pic.getWidth() / 2, -pic.getHeight() / 2); return pic; } - - private BitmapText createName(String name, boolean first, boolean own){ + private BitmapText createName(String name, boolean first, boolean own) { BitmapText hudText = new BitmapText(playerFont); //renderedSize = 45 hudText.setSize(TEXT_SIZE); hudText.setColor(first ? ACTIVE_COLOR : own ? OWN_COLOR : NORMAL_COLOR); hudText.setText(own ? name + " (Du)" : name); - hudText.setLocalTranslation(PADDING_LEFT,hudText.getHeight()/2, 0); + hudText.setLocalTranslation(PADDING_LEFT, hudText.getHeight() / 2, 0); return hudText; } - public void addPlayer(Color color, String name, boolean own){ - if(own) ownColor = color; + public void addPlayer(Color color, String name, boolean own) { + if (own) ownColor = color; colorNameMap.put(color, name); playerOrder.add(color); drawPlayers(); } public void setActivePlayer(Color color) { - if(playerOrder.get(0) == color) return; + if (playerOrder.get(0) == color) return; Color oldFirst = playerOrder.remove(0); playerOrder.remove(color); playerOrder.add(0, color); @@ -150,20 +146,20 @@ public void setActivePlayer(Color color) { drawPlayers(); } - public String getName(Color color){ - if(!colorNameMap.containsKey(color)) throw new RuntimeException("color is not in colorNameMap"); + public String getName(Color color) { + if (!colorNameMap.containsKey(color)) throw new RuntimeException("color is not in colorNameMap"); return colorNameMap.get(color); } - public void addCard(Color color){ + public void addCard(Color color) { colorCardMap.put(color, colorCardMap.getOrDefault(color, 0) + 1); drawPlayers(); } - public void removeCard(Color color){ - if(colorCardMap.containsKey(color)){ + public void removeCard(Color color) { + if (colorCardMap.containsKey(color)) { colorCardMap.put(color, colorCardMap.getOrDefault(color, 0) - 1); - if(colorCardMap.get(color) <= 0) colorCardMap.remove(color); + if (colorCardMap.get(color) <= 0) colorCardMap.remove(color); } drawPlayers(); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/OutlineFilter.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/OutlineFilter.java index 109e2de7..6074ee18 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/OutlineFilter.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/OutlineFilter.java @@ -13,67 +13,67 @@ public class OutlineFilter extends Filter { - private OutlinePreFilter outlinePreFilter; - private ColorRGBA outlineColor = new ColorRGBA(0, 1, 0, 1); - private float outlineWidth = 1; + private OutlinePreFilter outlinePreFilter; + private ColorRGBA outlineColor = new ColorRGBA(0, 1, 0, 1); + private float outlineWidth = 1; - public OutlineFilter(OutlinePreFilter outlinePreFilter) { - super("OutlineFilter"); - this.outlinePreFilter = outlinePreFilter; - } + public OutlineFilter(OutlinePreFilter outlinePreFilter) { + super("OutlineFilter"); + this.outlinePreFilter = outlinePreFilter; + } - @Override - protected void initFilter(AssetManager assetManager, RenderManager renderManager, ViewPort vp, int w, int h) { - MaterialDef matDef = (MaterialDef) assetManager.loadAsset("MatDefs/SelectObjectOutliner/Outline.j3md"); - material = new Material(matDef); - material.setVector2("Resolution", new Vector2f(w, h)); - material.setColor("OutlineColor", outlineColor); - material.setFloat("OutlineWidth", outlineWidth); - } + @Override + protected void initFilter(AssetManager assetManager, RenderManager renderManager, ViewPort vp, int w, int h) { + MaterialDef matDef = (MaterialDef) assetManager.loadAsset("MatDefs/SelectObjectOutliner/Outline.j3md"); + material = new Material(matDef); + material.setVector2("Resolution", new Vector2f(w, h)); + material.setColor("OutlineColor", outlineColor); + material.setFloat("OutlineWidth", outlineWidth); + } - @Override - protected void preFrame(float tpf) { - super.preFrame(tpf); - material.setTexture("OutlineDepthTexture", outlinePreFilter.getOutlineTexture()); + @Override + protected void preFrame(float tpf) { + super.preFrame(tpf); + material.setTexture("OutlineDepthTexture", outlinePreFilter.getOutlineTexture()); // System.out.println("OutlineFilter.preFrame()"); - } + } - @Override - protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) { - super.postFrame(renderManager, viewPort, prevFilterBuffer, sceneBuffer); + @Override + protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) { + super.postFrame(renderManager, viewPort, prevFilterBuffer, sceneBuffer); // material.setTexture("OutlineDepthTexture", outlinePreFilter.getDefaultPassDepthTexture()); // System.out.println("OutlineFilter.postFrame()"); - } + } - @Override - protected Material getMaterial() { - return material; - } + @Override + protected Material getMaterial() { + return material; + } - public ColorRGBA getOutlineColor() { - return outlineColor; - } + public ColorRGBA getOutlineColor() { + return outlineColor; + } - public void setOutlineColor(ColorRGBA outlineColor) { - this.outlineColor = outlineColor; - if (material != null) { - material.setColor("OutlineColor", outlineColor); - } - } + public void setOutlineColor(ColorRGBA outlineColor) { + this.outlineColor = outlineColor; + if (material != null) { + material.setColor("OutlineColor", outlineColor); + } + } - public float getOutlineWidth() { - return outlineWidth; - } + public float getOutlineWidth() { + return outlineWidth; + } - public void setOutlineWidth(float outlineWidth) { - this.outlineWidth = outlineWidth; - if (material != null) { - material.setFloat("OutlineWidth", outlineWidth); - } - } + public void setOutlineWidth(float outlineWidth) { + this.outlineWidth = outlineWidth; + if (material != null) { + material.setFloat("OutlineWidth", outlineWidth); + } + } - public OutlinePreFilter getOutlinePreFilter() { - return outlinePreFilter; - } + public OutlinePreFilter getOutlinePreFilter() { + return outlinePreFilter; + } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/OutlinePreFilter.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/OutlinePreFilter.java index cb2ae654..2e50cde0 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/OutlinePreFilter.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/OutlinePreFilter.java @@ -14,54 +14,54 @@ public class OutlinePreFilter extends Filter { - private Pass normalPass; - private RenderManager renderManager; + private Pass normalPass; + private RenderManager renderManager; - /** - * Creates a OutlinePreFilter - */ - public OutlinePreFilter() { - super("OutlinePreFilter"); - } + /** + * Creates a OutlinePreFilter + */ + public OutlinePreFilter() { + super("OutlinePreFilter"); + } - @Override - protected boolean isRequiresDepthTexture() { - return true; - } + @Override + protected boolean isRequiresDepthTexture() { + return true; + } - @Override - protected void postQueue(RenderQueue queue) { - Renderer r = renderManager.getRenderer(); - r.setFrameBuffer(normalPass.getRenderFrameBuffer()); - renderManager.getRenderer().clearBuffers(true, true, false); - } + @Override + protected void postQueue(RenderQueue queue) { + Renderer r = renderManager.getRenderer(); + r.setFrameBuffer(normalPass.getRenderFrameBuffer()); + renderManager.getRenderer().clearBuffers(true, true, false); + } - @Override - protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) { - super.postFrame(renderManager, viewPort, prevFilterBuffer, sceneBuffer); + @Override + protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) { + super.postFrame(renderManager, viewPort, prevFilterBuffer, sceneBuffer); - } + } - @Override - protected Material getMaterial() { - return material; - } + @Override + protected Material getMaterial() { + return material; + } - public Texture getOutlineTexture() { - return normalPass.getRenderedTexture(); - } + public Texture getOutlineTexture() { + return normalPass.getRenderedTexture(); + } - @Override - protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { - this.renderManager = renderManager; - normalPass = new Pass(); - normalPass.init(renderManager.getRenderer(), w, h, Format.RGBA8, Format.Depth); - material = new Material(manager, "MatDefs/SelectObjectOutliner/OutlinePre.j3md"); - } + @Override + protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) { + this.renderManager = renderManager; + normalPass = new Pass(); + normalPass.init(renderManager.getRenderer(), w, h, Format.RGBA8, Format.Depth); + material = new Material(manager, "MatDefs/SelectObjectOutliner/OutlinePre.j3md"); + } - @Override - protected void cleanUpFilter(Renderer r) { - normalPass.cleanup(r); - } + @Override + protected void cleanUpFilter(Renderer r) { + normalPass.cleanup(r); + } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/SelectObjectOutliner.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/SelectObjectOutliner.java index 0b5dd9ac..9609fb89 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/SelectObjectOutliner.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/SelectObjectOutliner.java @@ -3,7 +3,6 @@ import com.jme3.asset.AssetManager; import com.jme3.math.ColorRGBA; import com.jme3.post.FilterPostProcessor; -import com.jme3.post.filters.FXAAFilter; import com.jme3.renderer.Camera; import com.jme3.renderer.RenderManager; import com.jme3.renderer.ViewPort; @@ -19,7 +18,7 @@ public class SelectObjectOutliner { private final int width; private boolean selected; private ViewPort outlineViewport = null; -// private OutlineFilter outlineFilter = null; + // private OutlineFilter outlineFilter = null; private OutlineProFilter outlineFilter = null; private final MdgaApp app; @@ -34,49 +33,49 @@ public SelectObjectOutliner(int width, FilterPostProcessor fpp, RenderManager re } public void deselect(Spatial model) { - if(selected){ + if (selected) { selected = false; hideOutlineFilterEffect(model); } } public void select(Spatial model, ColorRGBA color) { - if(!selected){ + if (!selected) { selected = true; showOutlineFilterEffect(model, width, color); } } public void select(Spatial model, ColorRGBA color, int width) { - if(!selected){ + if (!selected) { selected = true; showOutlineFilterEffect(model, width, color); } } private void hideOutlineFilterEffect(Spatial model) { - outlineFilter.setEnabled(false); - outlineFilter.getOutlinePreFilter().setEnabled(false); - fpp.removeFilter(outlineFilter); - outlineViewport.detachScene(model); - outlineViewport.clearProcessors(); - renderManager.removePreView(outlineViewport); - outlineViewport = null; + outlineFilter.setEnabled(false); + outlineFilter.getOutlinePreFilter().setEnabled(false); + fpp.removeFilter(outlineFilter); + outlineViewport.detachScene(model); + outlineViewport.clearProcessors(); + renderManager.removePreView(outlineViewport); + outlineViewport = null; } private void showOutlineFilterEffect(Spatial model, int width, ColorRGBA color) { - outlineViewport = renderManager.createPreView("outlineViewport", cam); - FilterPostProcessor outlineFpp = new FilterPostProcessor(assetManager); + outlineViewport = renderManager.createPreView("outlineViewport", cam); + FilterPostProcessor outlineFpp = new FilterPostProcessor(assetManager); - OutlinePreFilter outlinePreFilter = new OutlinePreFilter(); - outlineFpp.addFilter(outlinePreFilter); - outlineViewport.attachScene(model); - outlineViewport.addProcessor(outlineFpp); + OutlinePreFilter outlinePreFilter = new OutlinePreFilter(); + outlineFpp.addFilter(outlinePreFilter); + outlineViewport.attachScene(model); + outlineViewport.addProcessor(outlineFpp); - outlineFilter = new OutlineProFilter(outlinePreFilter); - outlineFilter.setOutlineColor(color); - outlineFilter.setOutlineWidth(width); + outlineFilter = new OutlineProFilter(outlinePreFilter); + outlineFilter.setOutlineColor(color); + outlineFilter.setOutlineWidth(width); - fpp.addFilter(outlineFilter); + fpp.addFilter(outlineFilter); } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/server/MdgaServer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/server/MdgaServer.java index 0545fca7..9c1ac177 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/server/MdgaServer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/server/MdgaServer.java @@ -283,11 +283,10 @@ public void send(int id, ServerMessage message) { return; } final HostedConnection connection = myServer.getConnection(id); - if (connection != null){ + if (connection != null) { System.out.println("server sends to: " + id + " " + message.getClass().getName()); connection.send(message); - } - else LOGGER.log(Level.ERROR, "there is no connection with id={0}", id); //NON-NLS + } else LOGGER.log(Level.ERROR, "there is no connection with id={0}", id); //NON-NLS } /** diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/server/UUIDSerializer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/server/UUIDSerializer.java index ffc81778..e6a4c4bd 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/server/UUIDSerializer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/server/UUIDSerializer.java @@ -1,32 +1,29 @@ package pp.mdga.client.server; +import com.jme3.network.serializing.Serializer; + import java.io.IOException; import java.nio.ByteBuffer; import java.util.UUID; -import com.jme3.network.serializing.Serializer; - -public class UUIDSerializer extends Serializer -{ +public class UUIDSerializer extends Serializer { @Override - public T readObject(ByteBuffer data, Class c) throws IOException -{ - byte[] uuid = new byte[36]; - data.get(uuid); + public T readObject(ByteBuffer data, Class c) throws IOException { + byte[] uuid = new byte[36]; + data.get(uuid); - if(uuid.equals(new UUID(1, 1))) { - return null; - } else { - return (T) UUID.fromString(new String(uuid)); + if (uuid.equals(new UUID(1, 1))) { + return null; + } else { + return (T) UUID.fromString(new String(uuid)); + } } -} @Override - public void writeObject(ByteBuffer buffer, Object object) throws IOException - { + public void writeObject(ByteBuffer buffer, Object object) throws IOException { UUID uuid = (UUID) object; - if(uuid != null) { + if (uuid != null) { buffer.put(uuid.toString().getBytes()); } else { buffer.put(new UUID(1, 1).toString().getBytes()); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java index 4c2971a3..794ac270 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java @@ -103,7 +103,7 @@ public void onLeave() { backButton.hide(); continueButton.hide(); - if(null != background) { + if (null != background) { guiNode.detachChild(background); } @@ -118,7 +118,7 @@ public void onLeave() { @Override protected void onEnterOverlay(Overlay overlay) { - if(rootNode.hasChild(podest)) { + if (rootNode.hasChild(podest)) { rootNode.detachChild(podest); } } @@ -157,7 +157,7 @@ private void statistics() { private void enterSub(SubState state) { this.state = state; - if(rootNode.hasChild(podest)) { + if (rootNode.hasChild(podest)) { rootNode.detachChild(podest); } @@ -205,7 +205,7 @@ public void addCeremonyParticipant(Color color, int pos, String name) { ceremonyButtons.add(button); - if(state.equals(SubState.AWARD_CEREMONY)) { + if (state.equals(SubState.AWARD_CEREMONY)) { button.hide(); button.show(); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/GameView.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/GameView.java index f2a51ee2..d4d63897 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/GameView.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/GameView.java @@ -2,10 +2,10 @@ import com.jme3.post.FilterPostProcessor; import com.jme3.scene.Node; +import pp.mdga.client.MdgaApp; import pp.mdga.client.acoustic.MdgaSound; import pp.mdga.client.board.BoardHandler; import pp.mdga.client.board.CameraHandler; -import pp.mdga.client.MdgaApp; import pp.mdga.client.button.ButtonLeft; import pp.mdga.client.button.ButtonRight; import pp.mdga.client.dialog.InterruptDialog; @@ -84,14 +84,14 @@ public void onUpdate(float tpf) { @Override protected void onEnterOverlay(Overlay overlay) { - if(overlay == Overlay.SETTINGS) { + if (overlay == Overlay.SETTINGS) { leaveButton.show(); } } @Override protected void onLeaveOverlay(Overlay overlay) { - if(overlay == Overlay.SETTINGS) { + if (overlay == Overlay.SETTINGS) { leaveButton.hide(); } } @@ -101,7 +101,7 @@ private void leaveGame() { } public BoardHandler getBoardHandler() { - return boardHandler; + return boardHandler; } public GuiHandler getGuiHandler() { diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/LobbyView.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/LobbyView.java index f64623fd..c52ddc9b 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/LobbyView.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/LobbyView.java @@ -5,21 +5,15 @@ import com.jme3.material.Material; import com.jme3.math.ColorRGBA; import com.jme3.math.Vector3f; -import com.jme3.renderer.Camera; import com.jme3.scene.Geometry; -import com.jme3.scene.Spatial; import com.jme3.scene.shape.Quad; import com.jme3.texture.Texture; -import com.jme3.util.SkyFactory; import pp.mdga.client.MdgaApp; import pp.mdga.client.acoustic.MdgaSound; import pp.mdga.client.button.ButtonLeft; import pp.mdga.client.button.ButtonRight; import pp.mdga.client.button.LobbyButton; -import pp.mdga.client.button.SettingsButton; import pp.mdga.game.Color; -import pp.mdga.message.client.StartGameMessage; -import pp.mdga.notification.GameNotification; public class LobbyView extends MdgaView { private Geometry background; @@ -64,7 +58,7 @@ public void onEnter() { leaveButton.show(); readyButton.show(); - if(app.getGameLogic().isHost()) { + if (app.getGameLogic().isHost()) { startButton.show(); } @@ -114,10 +108,10 @@ public void onLeave() { app.getCamera().setParallelProjection(false); app.getCamera().setFrustumPerspective( - 45.0f, - (float) app.getCamera().getWidth() / app.getCamera().getHeight(), - 0.1f, - 1000.0f + 45.0f, + (float) app.getCamera().getWidth() / app.getCamera().getHeight(), + 0.1f, + 1000.0f ); app.getCamera().setLocation(new Vector3f(0, 0, 10)); @@ -150,23 +144,22 @@ protected void onEnterOverlay(Overlay overlay) { } @Override - protected void onLeaveOverlay(Overlay overlay) - { + protected void onLeaveOverlay(Overlay overlay) { } public void setTaken(Color color, boolean isTaken, boolean isSelf, String name) { LobbyButton.Taken taken; - if(isTaken) { - if(isSelf) { + if (isTaken) { + if (isSelf) { own = color; taken = LobbyButton.Taken.SELF; } else { taken = LobbyButton.Taken.OTHER; } } else { - if(isSelf) { + if (isSelf) { own = null; } @@ -204,10 +197,10 @@ public void setReady(Color color, boolean isReady) { this.isReady = isReady; } - if(!isReady) { + if (!isReady) { app.getAcousticHandler().playSound(MdgaSound.NOT_READY); } else { - if(button.getTaken() != LobbyButton.Taken.SELF) { + if (button.getTaken() != LobbyButton.Taken.SELF) { app.getAcousticHandler().playSound(MdgaSound.OTHER_READY); } } @@ -231,7 +224,7 @@ private void toggleTsk(Color color) { break; } - if(isReady) { + if (isReady) { setReady(own, false); } @@ -249,12 +242,12 @@ private void toggleTsk(Color color) { } public void ready() { - if(own == null) { + if (own == null) { app.getAcousticHandler().playSound(MdgaSound.WRONG_INPUT); return; } - if(!isReady) { + if (!isReady) { app.getAcousticHandler().playSound(MdgaSound.SELF_READY); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/MainView.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/MainView.java index abcd674c..7d57941d 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/MainView.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/MainView.java @@ -98,7 +98,7 @@ private void tryHost() { try { port = Integer.parseInt(text); - if(port >= 1 && port <= 65535) { + if (port >= 1 && port <= 65535) { app.getModelSynchronize().setName(startDialog.getName()); hostDialog.hostServer(); try { @@ -148,10 +148,10 @@ private void tryJoin() { private boolean isValidIpAddress(String ip) { String ipRegex = - "^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\." + - "(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\." + - "(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\." + - "(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$"; + "^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\." + + "(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\." + + "(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\\." + + "(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)$"; return ip != null && ip.matches(ipRegex); } @@ -159,7 +159,7 @@ private boolean isValidIpAddress(String ip) { private void enterSub(SubState state) { this.state = state; - if(null != background) { + if (null != background) { rootNode.detachChild(background); } @@ -198,7 +198,7 @@ public void forward(boolean host) { tryJoin(); break; case MAIN: - if(host) { + if (host) { enterSub(SubState.HOST); //TODO playSound } else { diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/MdgaView.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/MdgaView.java index a3da3d87..63114613 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/MdgaView.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/MdgaView.java @@ -11,7 +11,9 @@ import com.jme3.texture.Texture; import pp.mdga.client.MdgaApp; import pp.mdga.client.acoustic.MdgaSound; -import pp.mdga.client.button.*; +import pp.mdga.client.button.AbstractButton; +import pp.mdga.client.button.LabelButton; +import pp.mdga.client.button.SettingsButton; import pp.mdga.client.dialog.AudioSettingsDialog; import pp.mdga.client.dialog.SettingsDialog; import pp.mdga.client.dialog.VideoSettingsDialog; @@ -196,9 +198,9 @@ public void pressForward() { } if (this instanceof GameView gameView) { - if(gameView.needConfirm) { + if (gameView.needConfirm) { app.getModelSynchronize().confirm(); - } else if(gameView.needNoPower) { + } else if (gameView.needNoPower) { app.getModelSynchronize().confirm(); } else { app.getAcousticHandler().playSound(MdgaSound.WRONG_INPUT); @@ -213,7 +215,7 @@ public void pressForward() { public void showInfo(String error, boolean isError) { infoTimer.reset(); - if(null != infoLabel) { + if (null != infoLabel) { infoLabel.hide(); } @@ -221,7 +223,7 @@ public void showInfo(String error, boolean isError) { ColorRGBA color; - if(isError) { + if (isError) { color = ColorRGBA.Red.clone(); } else { color = ColorRGBA.Green.clone(); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/CeremonyState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/CeremonyState.java index e5d76ce2..f8060676 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/CeremonyState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/CeremonyState.java @@ -15,7 +15,7 @@ public class CeremonyState extends ClientState { * Creates a new CeremonyState * * @param parent the parent state - * @param logic the game logic + * @param logic the game logic */ public CeremonyState(ClientState parent, ClientGameLogic logic) { super(parent, logic); @@ -42,8 +42,8 @@ public void exit() { * * @param state the state to be set */ - public void setState(CeremonyStates state){ - if(this.currentState != null){ + public void setState(CeremonyStates state) { + if (this.currentState != null) { this.currentState.exit(); } state.enter(); @@ -55,7 +55,7 @@ public void setState(CeremonyStates state){ * * @return the PodiumState */ - public PodiumState getPodiumState(){ + public PodiumState getPodiumState() { return podiumState; } @@ -64,7 +64,7 @@ public PodiumState getPodiumState(){ * * @return the StatisticsState */ - public StatisticsState getStatisticsState(){ + public StatisticsState getStatisticsState() { return statisticsState; } @@ -73,16 +73,15 @@ public StatisticsState getStatisticsState(){ * * @return the current State */ - public CeremonyStates getState(){ + public CeremonyStates getState() { return currentState; } /** * this method is used to parse the selectNext from the clientGameLogic - * */ @Override - public void selectNext(){ + public void selectNext() { currentState.selectNext(); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientState.java index 642324ba..bfea68f1 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientState.java @@ -4,7 +4,6 @@ import pp.mdga.game.Color; import pp.mdga.game.Piece; import pp.mdga.message.server.*; -import pp.mdga.notification.CeremonyNotification; import java.lang.System.Logger.Level; @@ -15,7 +14,7 @@ public abstract class ClientState implements Observer, ServerInterpreter { protected ClientGameLogic logic; - protected ClientState(ClientState parent, ClientGameLogic logic){ + protected ClientState(ClientState parent, ClientGameLogic logic) { this.parent = parent; this.logic = logic; } @@ -24,14 +23,14 @@ protected ClientState(ClientState parent, ClientGameLogic logic){ public abstract void exit(); - public ClientState getParent(){ + public ClientState getParent() { return parent; } public void update() {/* do nothing */} @Override - public String toString(){ + public String toString() { return getClass().getSimpleName(); } @@ -101,7 +100,7 @@ public void received(ChoosePieceStateMessage msg) { } @Override - public void received(DrawCardMessage msg){ + public void received(DrawCardMessage msg) { LOGGER.log(Level.DEBUG, "Received {0} not allowed.", msg.toString()); } @@ -161,7 +160,9 @@ public void received(ServerStartGameMessage msg) { } @Override - public void received(ShutdownMessage msg) {LOGGER.log(Level.DEBUG, "Received {0} not allowed.", msg.toString());} + public void received(ShutdownMessage msg) { + LOGGER.log(Level.DEBUG, "Received {0} not allowed.", msg.toString()); + } @Override public void received(StartPieceMessage msg) { @@ -195,7 +196,7 @@ public void received(WaitPieceMessage msg) { @Override public void received(IncorrectRequestMessage msg) { - LOGGER.log(Level.DEBUG, "Received {0} not allowed.", msg.toString()); + LOGGER.log(Level.DEBUG, "Received {0} not allowed.", msg.toString()); } public void selectPiece(Piece piece) { @@ -238,23 +239,23 @@ public void deselectTSK(Color color) { LOGGER.log(Level.DEBUG, "Deselecting TSK not allowed."); } - public void selectUnready(){ + public void selectUnready() { LOGGER.log(Level.DEBUG, "Selecting unready not allowed."); } - public void selectStart(){ + public void selectStart() { LOGGER.log(Level.DEBUG, "Starting not allowed"); } - public void selectAnimationEnd(){ + public void selectAnimationEnd() { LOGGER.log(Level.DEBUG, "Animation end not allowed"); } - public void selectNext(){ + public void selectNext() { LOGGER.log(Level.DEBUG, "Next not allowed"); } - public void selectResume(){ + public void selectResume() { LOGGER.log(Level.DEBUG, "Resume not allowed"); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/DialogsState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/DialogsState.java index fc81beed..49910145 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/DialogsState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/DialogsState.java @@ -19,7 +19,7 @@ public class DialogsState extends ClientState { * Creates a new DialogsState * * @param parent the parent state - * @param logic the game logic + * @param logic the game logic */ public DialogsState(ClientState parent, ClientGameLogic logic) { super(parent, logic); @@ -29,7 +29,7 @@ public DialogsState(ClientState parent, ClientGameLogic logic) { * exits this state */ @Override - public void exit(){ + public void exit() { currentState.exit(); } @@ -37,7 +37,7 @@ public void exit(){ * Enters the new state machine */ @Override - public void enter(){ + public void enter() { setState(startDialogState); } @@ -46,8 +46,8 @@ public void enter(){ * * @param newState the state to be set */ - public void setState(DialogStates newState){ - if(currentState != null){ + public void setState(DialogStates newState) { + if (currentState != null) { currentState.exit(); } newState.enter(); @@ -85,7 +85,7 @@ public StartDialogState getStartDialog() { * This method is used to call the selectLeave method of the current state */ @Override - public void selectLeave(){ + public void selectLeave() { currentState.selectLeave(); } @@ -95,7 +95,7 @@ public void selectLeave(){ * @param name the name to be set */ @Override - public void setName(String name){ + public void setName(String name) { currentState.setName(name); } @@ -105,7 +105,7 @@ public void setName(String name){ * @param color the color to be set */ @Override - public void selectTSK(Color color){ + public void selectTSK(Color color) { currentState.selectTSK(color); } @@ -115,7 +115,7 @@ public void selectTSK(Color color){ * @param color the color to be deselected */ @Override - public void deselectTSK(Color color){ + public void deselectTSK(Color color) { currentState.deselectTSK(color); } @@ -123,7 +123,7 @@ public void deselectTSK(Color color){ * This method is used to call the selectReady method of the current state */ @Override - public void selectReady(){ + public void selectReady() { currentState.selectReady(); } @@ -131,7 +131,7 @@ public void selectReady(){ * This method is used to call the selectUnready method of the current state */ @Override - public void selectUnready(){ + public void selectUnready() { currentState.selectUnready(); } @@ -139,7 +139,7 @@ public void selectUnready(){ * This method is used to call the selectStart method of the current state */ @Override - public void selectStart(){ + public void selectStart() { currentState.selectStart(); } @@ -149,7 +149,7 @@ public void selectStart(){ * @param string the string to be set */ @Override - public void selectJoin(String string){ + public void selectJoin(String string) { currentState.selectJoin(string); } @@ -159,7 +159,7 @@ public void selectJoin(String string){ * @param name the name to be set */ @Override - public void selectHost(String name){ + public void selectHost(String name) { currentState.selectHost(name); } @@ -169,7 +169,7 @@ public void selectHost(String name){ * @param msg the LobbyPlayerJoin message received */ @Override - public void received(LobbyPlayerJoinedMessage msg){ + public void received(LobbyPlayerJoinedMessage msg) { currentState.received(msg); } @@ -179,7 +179,7 @@ public void received(LobbyPlayerJoinedMessage msg){ * @param msg the LobbyPlayerLeave message received */ @Override - public void received(LobbyPlayerLeaveMessage msg){ + public void received(LobbyPlayerLeaveMessage msg) { currentState.received(msg); } @@ -189,7 +189,7 @@ public void received(LobbyPlayerLeaveMessage msg){ * @param msg the UpdateTSKMessage message received */ @Override - public void received(UpdateTSKMessage msg){ + public void received(UpdateTSKMessage msg) { currentState.received(msg); } @@ -199,7 +199,7 @@ public void received(UpdateTSKMessage msg){ * @param msg the UpdateReady message received */ @Override - public void received(UpdateReadyMessage msg){ + public void received(UpdateReadyMessage msg) { currentState.received(msg); } @@ -209,7 +209,7 @@ public void received(UpdateReadyMessage msg){ * @param msg the ServerStartGame message received */ @Override - public void received(ServerStartGameMessage msg){ + public void received(ServerStartGameMessage msg) { currentState.received(msg); } @@ -219,7 +219,7 @@ public void received(ServerStartGameMessage msg){ * @param msg the LobbyAccept message received */ @Override - public void received(LobbyAcceptMessage msg){ + public void received(LobbyAcceptMessage msg) { currentState.received(msg); } @@ -229,7 +229,7 @@ public void received(LobbyAcceptMessage msg){ * @param msg the LobbyDeny message received */ @Override - public void received(LobbyDenyMessage msg){ + public void received(LobbyDenyMessage msg) { currentState.received(msg); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/GameState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/GameState.java index efb8293e..4309014b 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/GameState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/GameState.java @@ -4,16 +4,9 @@ import pp.mdga.game.BonusCard; import pp.mdga.game.Piece; import pp.mdga.game.card.HiddenCard; -import pp.mdga.game.card.ShieldCard; -import pp.mdga.game.card.SwapCard; -import pp.mdga.game.card.TurboCard; import pp.mdga.message.client.LeaveGameMessage; import pp.mdga.message.server.*; -import pp.mdga.notification.AcquireCardNotification; -import pp.mdga.notification.CeremonyNotification; -import pp.mdga.notification.DrawCardNotification; -import pp.mdga.notification.InterruptNotification; -import pp.mdga.notification.StartDialogNotification; +import pp.mdga.notification.*; public class GameState extends ClientState { @@ -32,7 +25,7 @@ public class GameState extends ClientState { * Constructor for GameState * * @param parent the parent of this state - * @param logic the ClientGameLogic + * @param logic the ClientGameLogic */ public GameState(ClientState parent, ClientGameLogic logic) { super(parent, logic); @@ -59,8 +52,8 @@ public void exit() { * * @param newState the state to be set */ - public void setState(GameStates newState){ - if(this.state != null){ + public void setState(GameStates newState) { + if (this.state != null) { this.state.exit(); } System.out.println("CLIENT STATE old: " + this.state + " new: " + newState); @@ -72,7 +65,7 @@ public void setState(GameStates newState){ * This method is used to call the selectAnimationEnd method of the current state */ @Override - public void selectAnimationEnd(){ + public void selectAnimationEnd() { state.selectAnimationEnd(); } @@ -80,7 +73,7 @@ public void selectAnimationEnd(){ * This method is used to call the selectDice method of the current state */ @Override - public void selectDice(){ + public void selectDice() { state.selectDice(); } @@ -90,7 +83,7 @@ public void selectDice(){ * @param piece the piece to be selected */ @Override - public void selectPiece(Piece piece){ + public void selectPiece(Piece piece) { state.selectPiece(piece); } @@ -100,7 +93,7 @@ public void selectPiece(Piece piece){ * @param card the card to be selected */ @Override - public void selectCard(BonusCard card){ + public void selectCard(BonusCard card) { state.selectCard(card); } @@ -110,13 +103,13 @@ public void selectCard(BonusCard card){ * @param msg the message to be received */ @Override - public void received(PauseGameMessage msg){ + public void received(PauseGameMessage msg) { logic.enterInterrupt(); logic.addNotification(new InterruptNotification(logic.getGame().getPlayers().get(msg.getPlayerId()).getColor())); } @Override - public void selectLeave(){ + public void selectLeave() { logic.send(new LeaveGameMessage()); logic.addNotification(new StartDialogNotification()); logic.setState(logic.getDialogs()); @@ -128,7 +121,7 @@ public void selectLeave(){ * @param msg the message to be received */ @Override - public void received(DieMessage msg){ + public void received(DieMessage msg) { state.received(msg); } @@ -138,7 +131,7 @@ public void received(DieMessage msg){ * @param msg the message to be received */ @Override - public void received(RankingRollAgainMessage msg){ + public void received(RankingRollAgainMessage msg) { state.received(msg); } @@ -148,7 +141,7 @@ public void received(RankingRollAgainMessage msg){ * @param msg the message to be received */ @Override - public void received(RankingResponseMessage msg){ + public void received(RankingResponseMessage msg) { state.received(msg); } @@ -158,7 +151,7 @@ public void received(RankingResponseMessage msg){ * @param msg the message to be received */ @Override - public void received(SelectPieceMessage msg){ + public void received(SelectPieceMessage msg) { state.received(msg); } @@ -168,7 +161,7 @@ public void received(SelectPieceMessage msg){ * @param msg the message to be received */ @Override - public void received(WaitPieceMessage msg){ + public void received(WaitPieceMessage msg) { state.received(msg); } @@ -178,7 +171,7 @@ public void received(WaitPieceMessage msg){ * @param msg the message to be received */ @Override - public void received(StartPieceMessage msg){ + public void received(StartPieceMessage msg) { state.received(msg); } @@ -188,7 +181,7 @@ public void received(StartPieceMessage msg){ * @param msg the message to be received */ @Override - public void received(NoTurnMessage msg){ + public void received(NoTurnMessage msg) { state.received(msg); } @@ -198,7 +191,7 @@ public void received(NoTurnMessage msg){ * @param msg the message to be received */ @Override - public void received(MoveMessage msg){ + public void received(MoveMessage msg) { state.received(msg); } @@ -208,7 +201,7 @@ public void received(MoveMessage msg){ * @param msg the message to be received */ @Override - public void received(CeremonyMessage msg){ + public void received(CeremonyMessage msg) { CeremonyNotification notification = new CeremonyNotification(); notification.setColors(msg.getColors()); notification.setNames(msg.getNames()); @@ -228,7 +221,7 @@ public void received(CeremonyMessage msg){ * @param msg the message to be received */ @Override - public void received(EndOfTurnMessage msg){ + public void received(EndOfTurnMessage msg) { state.received(msg); } @@ -238,7 +231,7 @@ public void received(EndOfTurnMessage msg){ * @param msg the message to be received */ @Override - public void received(SpectatorMessage msg){ + public void received(SpectatorMessage msg) { state.received(msg); } @@ -248,7 +241,7 @@ public void received(SpectatorMessage msg){ * @param msg the message to be received */ @Override - public void received(DiceAgainMessage msg){ + public void received(DiceAgainMessage msg) { state.received(msg); } @@ -258,7 +251,7 @@ public void received(DiceAgainMessage msg){ * @param msg the message to be received */ @Override - public void received(PossibleCardsMessage msg){ + public void received(PossibleCardsMessage msg) { state.received(msg); } @@ -268,7 +261,7 @@ public void received(PossibleCardsMessage msg){ * @param msg the message to be received */ @Override - public void received(PlayCardMessage msg){ + public void received(PlayCardMessage msg) { state.received(msg); } @@ -278,7 +271,7 @@ public void received(PlayCardMessage msg){ * @param msg the message to be received */ @Override - public void received(DiceNowMessage msg){ + public void received(DiceNowMessage msg) { state.received(msg); } @@ -288,27 +281,26 @@ public void received(DiceNowMessage msg){ * @param msg the message to be received */ @Override - public void received(ActivePlayerMessage msg){ + public void received(ActivePlayerMessage msg) { state.received(msg); } @Override - public void received(PossiblePieceMessage msg){ + public void received(PossiblePieceMessage msg) { state.received(msg); } @Override - public void received(ChoosePieceStateMessage msg){ + public void received(ChoosePieceStateMessage msg) { state.received(msg); } @Override - public void received(DrawCardMessage msg){ + public void received(DrawCardMessage msg) { logic.getGame().getActivePlayer().addHandCard(msg.getCard()); if (msg.getCard() instanceof HiddenCard) { logic.addNotification(new DrawCardNotification(logic.getGame().getActiveColor(), BonusCard.HIDDEN)); - } - else{ + } else { logic.addNotification(new AcquireCardNotification(msg.getCard().getCard())); } @@ -319,7 +311,7 @@ public void received(DrawCardMessage msg){ * * @return the current state */ - public GameStates getState(){ + public GameStates getState() { return state; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/InterruptState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/InterruptState.java index 33ec5a4f..cfaf8580 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/InterruptState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/InterruptState.java @@ -2,7 +2,6 @@ import pp.mdga.message.client.ForceContinueGameMessage; import pp.mdga.message.server.ResumeGameMessage; -import pp.mdga.notification.ResumeNotification; public class InterruptState extends ClientState { @@ -12,7 +11,7 @@ public class InterruptState extends ClientState { * Creates a new InterruptState * * @param parent the parent state - * @param logic the game logic + * @param logic the game logic */ public InterruptState(ClientState parent, ClientGameLogic logic) { super(parent, logic); @@ -56,8 +55,8 @@ public ClientState getPreviousState() { * The host resumes the game */ @Override - public void selectResume(){ - if(logic.isHost()){ + public void selectResume() { + if (logic.isHost()) { logic.send(new ForceContinueGameMessage()); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/SettingsState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/SettingsState.java index 6d0d5855..fd9f822f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/SettingsState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/SettingsState.java @@ -20,7 +20,7 @@ public class SettingsState extends ClientState { * Creates a new SettingsState * * @param parent the parent state - * @param logic the game logic + * @param logic the game logic */ public SettingsState(ClientState parent, ClientGameLogic logic) { super(parent, logic); @@ -45,28 +45,28 @@ public void exit() { /** * Changes the current state */ - public SettingStates getState(){ + public SettingStates getState() { return currentState; } /** * Returns the main settings state */ - public MainSettingsState getMainSettingsState(){ + public MainSettingsState getMainSettingsState() { return mainSettingsState; } /** * Returns the audio settings state */ - public AudioSettingsState getAudioSettingsState(){ + public AudioSettingsState getAudioSettingsState() { return audioSettingsState; } /** * Returns the video settings state */ - public VideoSettingsState getVideoSettingsState(){ + public VideoSettingsState getVideoSettingsState() { return videoSettingsState; } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/PodiumState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/PodiumState.java index 374cf996..5844e381 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/PodiumState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/PodiumState.java @@ -24,7 +24,7 @@ public void exit() { } @Override - public void selectNext(){ + public void selectNext() { parent.setState(parent.getStatisticsState()); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java index 3466831a..3dcbd1a5 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java @@ -19,7 +19,7 @@ public void exit() { } @Override - public void selectNext(){ + public void selectNext() { logic.setState(logic.getDialogs()); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/DialogStates.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/DialogStates.java index 26f0ff26..12a4ad8a 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/DialogStates.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/DialogStates.java @@ -5,7 +5,7 @@ public abstract class DialogStates extends ClientState { - public DialogStates(ClientState parent, ClientGameLogic logic){ + public DialogStates(ClientState parent, ClientGameLogic logic) { super(parent, logic); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/LobbyState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/LobbyState.java index 45a2aeb1..499bcc08 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/LobbyState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/LobbyState.java @@ -72,8 +72,8 @@ public void selectStart() { @Override public void received(ServerStartGameMessage msg) { - for (Player player: msg.getPlayers()) { - for (Map.Entry entry: this.logic.getGame().getPlayers().entrySet()) { + for (Player player : msg.getPlayers()) { + for (Map.Entry entry : this.logic.getGame().getPlayers().entrySet()) { if (entry.getValue().getColor() == player.getColor()) { this.logic.getGame().getPlayers().put(entry.getKey(), player); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/NetworkDialogState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/NetworkDialogState.java index 5f6236c8..90f7ab84 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/NetworkDialogState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/NetworkDialogState.java @@ -15,8 +15,9 @@ public class NetworkDialogState extends DialogStates { /** * Constructor for the NetworkDialogState + * * @param parent the parent state - * @param logic the logic + * @param logic the logic */ public NetworkDialogState(ClientState parent, ClientGameLogic logic) { super(parent, logic); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/StartDialogState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/StartDialogState.java index 2c0f879e..89f1cc3f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/StartDialogState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/StartDialogState.java @@ -10,8 +10,9 @@ public class StartDialogState extends DialogStates { /** * Constructor for the StartDialogState + * * @param parent the parent state - * @param logic the logic + * @param logic the logic */ public StartDialogState(ClientState parent, ClientGameLogic logic) { super(parent, logic); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java index 7f006cbc..616ad863 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java @@ -26,7 +26,7 @@ public void exit() { } @Override - public void selectAnimationEnd(){ + public void selectAnimationEnd() { logic.send(new AnimationEndMessage()); parent.setState(parent.getWaiting()); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/DetermineStartPlayerState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/DetermineStartPlayerState.java index c749ffbc..46e0596d 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/DetermineStartPlayerState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/DetermineStartPlayerState.java @@ -7,7 +7,6 @@ import pp.mdga.client.gamestate.determinestartplayerstate.Intro; import pp.mdga.client.gamestate.determinestartplayerstate.RollRankingDiceState; import pp.mdga.client.gamestate.determinestartplayerstate.WaitRankingState; -import pp.mdga.message.client.AnimationEndMessage; import pp.mdga.message.server.*; public class DetermineStartPlayerState extends GameStates { @@ -32,11 +31,11 @@ public WaitRankingState getWaitRanking() { return waitRankingState; } - public DetermineStartPlayerStates getState(){ + public DetermineStartPlayerStates getState() { return state; } - public Intro getIntro(){ + public Intro getIntro() { return intro; } @@ -56,7 +55,7 @@ public void exit() { public void setState(DetermineStartPlayerStates state) { System.out.println("CLIENT STATE old: " + this.state + " new: " + state); - if(this.state != null){ + if (this.state != null) { this.state.exit(); } this.state = state; @@ -69,32 +68,32 @@ public void selectDice() { } @Override - public void selectAnimationEnd(){ + public void selectAnimationEnd() { state.selectAnimationEnd(); } @Override - public void received(DieMessage msg){ + public void received(DieMessage msg) { state.received(msg); } @Override - public void received(DiceNowMessage msg){ + public void received(DiceNowMessage msg) { state.received(msg); } @Override - public void received(RankingRollAgainMessage msg){ + public void received(RankingRollAgainMessage msg) { state.received(msg); } @Override - public void received(RankingResponseMessage msg){ + public void received(RankingResponseMessage msg) { state.received(msg); } @Override - public void received(ActivePlayerMessage msg){ + public void received(ActivePlayerMessage msg) { state.received(msg); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/GameStates.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/GameStates.java index e8d5555c..172a9be8 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/GameStates.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/GameStates.java @@ -2,19 +2,12 @@ import pp.mdga.client.ClientGameLogic; import pp.mdga.client.ClientState; -import pp.mdga.game.Board; -import pp.mdga.game.BonusCard; -import pp.mdga.game.Node; -import pp.mdga.game.Piece; -import pp.mdga.game.PieceState; -import pp.mdga.game.ShieldState; +import pp.mdga.game.*; import pp.mdga.message.server.PlayCardMessage; import pp.mdga.notification.ShieldActiveNotification; import pp.mdga.notification.ShieldSuppressedNotification; import pp.mdga.notification.SwapPieceNotification; -import pp.mdga.notification.ThrowPieceNotification; -import java.util.List; import java.util.UUID; public abstract class GameStates extends ClientState { @@ -40,7 +33,7 @@ protected void handlePowerCard(PlayCardMessage msg) { private void handleShield(UUID uuid) { Board board = logic.getGame().getBoard(); Piece piece = logic.getGame().getPieceThroughUUID(uuid); - Node node = board.getInfield()[board.getInfieldIndexOfPiece(piece)]; + Node node = board.getInfield()[board.getInfieldIndexOfPiece(piece)]; if (node.isStart()) { logic.getGame().getPieceThroughUUID(uuid).setShield(ShieldState.SUPPRESSED); logic.addNotification(new ShieldActiveNotification(uuid)); @@ -68,13 +61,13 @@ private void swapPieces(Piece messageOwn, Piece messageEnemy) { } - private void checkShieldAfterSwap(Node node, Piece piece){ - if (node.isStart()){ - if (piece.isShielded()){ + private void checkShieldAfterSwap(Node node, Piece piece) { + if (node.isStart()) { + if (piece.isShielded()) { piece.setShield(ShieldState.SUPPRESSED); logic.addNotification(new ShieldSuppressedNotification(piece.getUuid())); } - } else if (piece.isSuppressed()){ + } else if (piece.isSuppressed()) { piece.setShield(ShieldState.ACTIVE); logic.addNotification(new ShieldActiveNotification(piece.getUuid())); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java index 79df327e..5c2629f3 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java @@ -35,7 +35,7 @@ public void received(CeremonyMessage msg) { } @Override - public void received(DrawCardMessage msg){ + public void received(DrawCardMessage msg) { logic.getGame().getActivePlayer().addHandCard(msg.getCard()); if (msg.getCard() instanceof HiddenCard) { logic.addNotification(new DrawCardNotification(logic.getGame().getActiveColor(), BonusCard.HIDDEN)); @@ -87,14 +87,14 @@ public void received(MoveMessage msg) { if (occ != null) { //TODO: MoveThrowNotification logic.addNotification(new ThrowPieceNotification(occ.getUuid(), piece.getColor())); - if (occ.isSuppressed()){ + if (occ.isSuppressed()) { logic.addNotification(new RemoveShieldNotification(occ.getUuid())); occ.setShield(ShieldState.NONE); } //set occ to waiting logic.getGame().getPlayerByColor(occ.getColor()).addWaitingPiece(occ); } - if(msg.getPiece().getState().equals(PieceState.WAITING)){ + if (msg.getPiece().getState().equals(PieceState.WAITING)) { logic.addNotification(new MovePieceNotification(piece.getUuid(), msg.getTargetIndex(), true)); logic.getGame().getPlayerByColor(piece.getColor()).removeWaitingPiece(piece); piece.setState(PieceState.ACTIVE); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/TurnState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/TurnState.java index ec119d18..835a2a9c 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/TurnState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/TurnState.java @@ -3,23 +3,12 @@ import pp.mdga.client.ClientGameLogic; import pp.mdga.client.ClientState; import pp.mdga.client.GameState; -import pp.mdga.client.gamestate.turnstate.ChoosePieceState; -import pp.mdga.client.gamestate.turnstate.MovePieceState; -import pp.mdga.client.gamestate.turnstate.PlayPowerCardState; -import pp.mdga.client.gamestate.turnstate.PowerCardState; -import pp.mdga.client.gamestate.turnstate.RollDiceState; -import pp.mdga.client.gamestate.turnstate.TurnStates; +import pp.mdga.client.gamestate.turnstate.*; import pp.mdga.game.BonusCard; import pp.mdga.game.Piece; import pp.mdga.game.ShieldState; -import pp.mdga.game.card.HiddenCard; -import pp.mdga.game.card.ShieldCard; -import pp.mdga.game.card.SwapCard; -import pp.mdga.game.card.TurboCard; import pp.mdga.message.server.*; import pp.mdga.notification.RemoveShieldNotification; -import pp.mdga.notification.AcquireCardNotification; -import pp.mdga.notification.DrawCardNotification; public class TurnState extends GameStates { @@ -42,7 +31,7 @@ public TurnState(ClientState parent, ClientGameLogic logic) { public void enter() { logic = logic; for (Piece piece : logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getPieces()) { - if (piece.isShielded() || piece.isSuppressed()){ + if (piece.isShielded() || piece.isSuppressed()) { piece.setShield(ShieldState.NONE); logic.addNotification(new RemoveShieldNotification(piece.getUuid())); } @@ -56,9 +45,9 @@ public void exit() { state = null; } - public void setState(TurnStates state){ + public void setState(TurnStates state) { System.out.println("CLIENT STATE old: " + this.state + " new: " + state); - if(this.state != null){ + if (this.state != null) { this.state.exit(); } state.enter(); @@ -66,97 +55,97 @@ public void setState(TurnStates state){ } @Override - public void selectDice(){ + public void selectDice() { state.selectDice(); } @Override - public void selectPiece(Piece piece){ + public void selectPiece(Piece piece) { state.selectPiece(piece); } @Override - public void selectCard(BonusCard card){ + public void selectCard(BonusCard card) { state.selectCard(card); } @Override - public void selectAnimationEnd(){ + public void selectAnimationEnd() { state.selectAnimationEnd(); } @Override - public void received(SelectPieceMessage msg){ + public void received(SelectPieceMessage msg) { state.received(msg); } @Override - public void received(WaitPieceMessage msg){ + public void received(WaitPieceMessage msg) { state.received(msg); } @Override - public void received(StartPieceMessage msg){ + public void received(StartPieceMessage msg) { state.received(msg); } @Override - public void received(NoTurnMessage msg){ + public void received(NoTurnMessage msg) { state.received(msg); } @Override - public void received(MoveMessage msg){ + public void received(MoveMessage msg) { state.received(msg); } @Override - public void received(CeremonyMessage msg){ + public void received(CeremonyMessage msg) { state.received(msg); } @Override - public void received(EndOfTurnMessage msg){ + public void received(EndOfTurnMessage msg) { state.received(msg); } @Override - public void received(SpectatorMessage msg){ + public void received(SpectatorMessage msg) { state.received(msg); } @Override - public void received(DiceAgainMessage msg){ + public void received(DiceAgainMessage msg) { state.received(msg); } @Override - public void received(PossibleCardsMessage msg){ + public void received(PossibleCardsMessage msg) { state.received(msg); } @Override - public void received(PlayCardMessage msg){ + public void received(PlayCardMessage msg) { state.received(msg); } @Override - public void received(DiceNowMessage msg){ + public void received(DiceNowMessage msg) { state.received(msg); } @Override - public void received(DieMessage msg){ + public void received(DieMessage msg) { state.received(msg); } @Override - public void received(PossiblePieceMessage msg){ + public void received(PossiblePieceMessage msg) { state.received(msg); } @Override - public void received(ChoosePieceStateMessage msg){ + public void received(ChoosePieceStateMessage msg) { state.received(msg); } @@ -180,11 +169,11 @@ public RollDiceState getRollDice() { return rollDiceState; } - public GameState getParent(){ + public GameState getParent() { return parent; } - public TurnStates getState(){ + public TurnStates getState() { return state; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java index d6b26e7d..5496f6ca 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java @@ -38,10 +38,9 @@ public void received(CeremonyMessage msg) { @Override public void received(DieMessage msg) { logic.getGame().setDiceEyes(msg.getDiceEye()); - if(logic.getGame().getTurboFlag()){ + if (logic.getGame().getTurboFlag()) { logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), msg.getDiceEye(), logic.getGame().getDiceModifier())); - } - else { + } else { logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), msg.getDiceEye())); } @@ -65,11 +64,11 @@ public void received(PlayCardMessage msg) { public void received(ActivePlayerMessage msg) { logic.addNotification(new ActivePlayerNotification(msg.getColor())); logic.getGame().setActiveColor(msg.getColor()); - if(msg.getColor() == logic.getGame().getPlayers().get(logic.getOwnPlayerId()).getColor()) { + if (msg.getColor() == logic.getGame().getPlayers().get(logic.getOwnPlayerId()).getColor()) { parent.setState(parent.getTurn()); } else { - for (Piece piece : logic.getGame().getActivePlayer().getPieces()){ - if (piece.isShielded() || piece.isSuppressed()){ + for (Piece piece : logic.getGame().getActivePlayer().getPieces()) { + if (piece.isShielded() || piece.isSuppressed()) { logic.addNotification(new RemoveShieldNotification(piece.getUuid())); piece.setShield(ShieldState.NONE); } @@ -81,7 +80,7 @@ public void received(ActivePlayerMessage msg) { public void received(MoveMessage msg) { Piece piece = logic.getGame().getPieceThroughUUID(msg.getPiece().getUuid()); if (msg.isHomeMove()) { - if(piece.getState().equals(PieceState.HOME)){ + if (piece.getState().equals(PieceState.HOME)) { logic.addNotification(new HomeMoveNotification(piece.getUuid(), msg.getTargetIndex())); int pieceHomeIndex = logic.getGame().getActivePlayer().getHomeIndexOfPiece(piece); Node pieceNode = logic.getGame().getActivePlayer().getHomeNodes()[pieceHomeIndex]; @@ -91,18 +90,16 @@ public void received(MoveMessage msg) { Node oldNode = logic.getGame().getActivePlayer().getHomeNodes()[homeIndex]; //gets the targetNode Node targetNode = logic.getGame().getActivePlayer().getHomeNodes()[msg.getTargetIndex()]; - if (msg.getTargetIndex() ==logic.getGame().getActivePlayer().getHighestHomeIdx()) { + if (msg.getTargetIndex() == logic.getGame().getActivePlayer().getHighestHomeIdx()) { piece.setState(PieceState.HOMEFINISHED); - } - else{ + } else { piece.setState(PieceState.HOME); } oldNode.clearOccupant(); targetNode.setOccupant(piece); - } - else{ + } else { logic.addNotification(new HomeMoveNotification(piece.getUuid(), msg.getTargetIndex())); int oldNoteIdx = logic.getGame().getBoard().getInfieldIndexOfPiece(piece); Node oldNode = logic.getGame().getBoard().getInfield()[oldNoteIdx]; @@ -110,31 +107,29 @@ public void received(MoveMessage msg) { //gets the targetNode Node targetNode = logic.getGame().getActivePlayer().getHomeNodes()[msg.getTargetIndex()]; - if (msg.getTargetIndex() ==logic.getGame().getActivePlayer().getHighestHomeIdx()) { + if (msg.getTargetIndex() == logic.getGame().getActivePlayer().getHighestHomeIdx()) { piece.setState(PieceState.HOMEFINISHED); - } - else{ + } else { piece.setState(PieceState.HOME); } oldNode.clearOccupant(); targetNode.setOccupant(piece); } - } - else { + } else { int oldIndex = logic.getGame().getBoard().getInfieldIndexOfPiece(piece); Piece occ = logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].getOccupant(); if (occ != null) { //TODO: MoveThrowNotification logic.addNotification(new ThrowPieceNotification(occ.getUuid(), piece.getColor())); - if (occ.isSuppressed()){ + if (occ.isSuppressed()) { logic.addNotification(new RemoveShieldNotification(occ.getUuid())); occ.setShield(ShieldState.NONE); } //set occ to waiting logic.getGame().getPlayerByColor(occ.getColor()).addWaitingPiece(occ); } - if(oldIndex == -1){ + if (oldIndex == -1) { logic.addNotification(new MovePieceNotification(piece.getUuid(), msg.getTargetIndex(), true)); logic.getGame().getPlayerByColor(piece.getColor()).removeWaitingPiece(piece); piece.setState(PieceState.ACTIVE); @@ -145,12 +140,12 @@ public void received(MoveMessage msg) { } //set new node logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].setOccupant(piece); - if (logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].isStart()){ - if (piece.isShielded()){ + if (logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].isStart()) { + if (piece.isShielded()) { piece.setShield(ShieldState.SUPPRESSED); logic.addNotification(new ShieldSuppressedNotification(piece.getUuid())); } - } else if (piece.isSuppressed()){ + } else if (piece.isSuppressed()) { piece.setShield(ShieldState.ACTIVE); logic.addNotification(new ShieldActiveNotification(piece.getUuid())); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/Intro.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/Intro.java index f3642f78..d2310eb0 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/Intro.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/Intro.java @@ -13,7 +13,7 @@ import java.util.Map; -public class Intro extends DetermineStartPlayerStates{ +public class Intro extends DetermineStartPlayerStates { private final DetermineStartPlayerState parent; @@ -23,7 +23,7 @@ public class Intro extends DetermineStartPlayerStates{ * Constructor for Intro * * @param parent the parent state - * @param logic the client game logic + * @param logic the client game logic */ public Intro(ClientState parent, ClientGameLogic logic) { super(parent, logic); @@ -35,7 +35,7 @@ public Intro(ClientState parent, ClientGameLogic logic) { * * @return the parent state */ - public DetermineStartPlayerState getParent(){ + public DetermineStartPlayerState getParent() { return parent; } @@ -44,13 +44,13 @@ public DetermineStartPlayerState getParent(){ */ @Override public void enter() { - for(Map.Entry entry : logic.getGame().getPlayers().entrySet()){ + for (Map.Entry entry : logic.getGame().getPlayers().entrySet()) { logic.addNotification(new MovePieceNotification(entry.getValue().getPieces()[0].getUuid(), entry.getValue().getStartNodeIndex(), true)); logic.getGame().getBoard().getInfield()[entry.getValue().getStartNodeIndex()].setOccupant(entry.getValue().getPieces()[0]); entry.getValue().getWaitingArea()[0] = null; animationCounter++; - for (PowerCard card : entry.getValue().getHandCards()){ - if(entry.getKey() == logic.getOwnPlayerId()){ + for (PowerCard card : entry.getValue().getHandCards()) { + if (entry.getKey() == logic.getOwnPlayerId()) { logic.addNotification(new AcquireCardNotification(card.getCard())); } else { logic.addNotification(new DrawCardNotification(entry.getValue().getColor(), card.getCard())); @@ -71,13 +71,13 @@ public void exit() { * This method is used when the view has completed the animation. */ @Override - public void selectAnimationEnd(){ + public void selectAnimationEnd() { animationCounter--; - if(animationCounter != 0){ + if (animationCounter != 0) { return; } logic.send(new AnimationEndMessage()); - if (logic.getGame().getActivePlayerId() == logic.getOwnPlayerId()){ + if (logic.getGame().getActivePlayerId() == logic.getOwnPlayerId()) { parent.getParent().setState(parent.getParent().getTurn()); logic.addNotification(new ActivePlayerNotification(logic.getGame().getActiveColor())); } else { diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/RollRankingDiceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/RollRankingDiceState.java index 626521df..4b7fcbde 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/RollRankingDiceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/RollRankingDiceState.java @@ -13,7 +13,7 @@ public class RollRankingDiceState extends DetermineStartPlayerStates { private final System.Logger LOGGER = System.getLogger(this.getClass().getName()); private final DetermineStartPlayerState parent; - private boolean isRolled =false; + private boolean isRolled = false; public RollRankingDiceState(ClientState parent, ClientGameLogic logic) { super(parent, logic); @@ -29,20 +29,20 @@ public void enter() { @Override public void exit() { LOGGER.log(System.Logger.Level.INFO, "Exiting RollRankingDiceState"); - isRolled=false; + isRolled = false; } @Override - public void selectDice(){ - if(!isRolled){ + public void selectDice() { + if (!isRolled) { isRolled = true; logic.send(new RequestDieMessage()); } } @Override - public void received(DieMessage msg){ + public void received(DieMessage msg) { parent.setState(parent.getWaitRanking()); - logic.addNotification(new RollDiceNotification(logic.getGame().getPlayerById(logic.getOwnPlayerId()).getColor(), msg.getDiceEye(),true)); + logic.addNotification(new RollDiceNotification(logic.getGame().getPlayerById(logic.getOwnPlayerId()).getColor(), msg.getDiceEye(), true)); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/WaitRankingState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/WaitRankingState.java index 78787453..6077d5d1 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/WaitRankingState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/WaitRankingState.java @@ -5,8 +5,9 @@ import pp.mdga.client.gamestate.DetermineStartPlayerState; import pp.mdga.game.Color; import pp.mdga.message.client.AnimationEndMessage; -import pp.mdga.message.server.*; -import pp.mdga.notification.ActivePlayerNotification; +import pp.mdga.message.server.ActivePlayerMessage; +import pp.mdga.message.server.DiceNowMessage; +import pp.mdga.message.server.RankingResponseMessage; import pp.mdga.notification.RankingResponceNotification; import java.util.HashMap; @@ -24,8 +25,8 @@ public WaitRankingState(ClientState parent, ClientGameLogic logic) { this.parent = (DetermineStartPlayerState) parent; } - private void changeToIntro(){ - if(!canChange){ + private void changeToIntro() { + if (!canChange) { canChange = true; return; } @@ -44,12 +45,12 @@ public void exit() { } @Override - public void received(DiceNowMessage msg){ + public void received(DiceNowMessage msg) { parent.setState(parent.getRollRankingDice()); } @Override - public void received(RankingResponseMessage msg){ + public void received(RankingResponseMessage msg) { Map rankingResults = new HashMap<>(); for (var entry : msg.getRankingResults().entrySet()) { rankingResults.put(logic.getGame().getPlayerById(entry.getKey()).getColor(), entry.getValue()); @@ -58,13 +59,13 @@ public void received(RankingResponseMessage msg){ } @Override - public void selectAnimationEnd(){ + public void selectAnimationEnd() { changeToIntro(); logic.send(new AnimationEndMessage()); } @Override - public void received(ActivePlayerMessage msg){ + public void received(ActivePlayerMessage msg) { logic.getGame().setActiveColor(msg.getColor()); changeToIntro(); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java index 226a150f..b205b992 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java @@ -30,12 +30,12 @@ public void enter() { @Override public void exit() { currentState.exit(); - currentState= null; + currentState = null; } - public void setState(ChoosePieceStates state){ + public void setState(ChoosePieceStates state) { System.out.println("CLIENT STATE old: " + this.currentState + " new: " + state); - if(currentState != null){ + if (currentState != null) { currentState.exit(); } state.enter(); @@ -43,56 +43,56 @@ public void setState(ChoosePieceStates state){ } @Override - public void selectPiece(Piece piece){ + public void selectPiece(Piece piece) { currentState.selectPiece(piece); } @Override - public void received(SelectPieceMessage msg){ + public void received(SelectPieceMessage msg) { currentState.received(msg); } @Override - public void received(WaitPieceMessage msg){ + public void received(WaitPieceMessage msg) { currentState.received(msg); } @Override - public void received(StartPieceMessage msg){ + public void received(StartPieceMessage msg) { currentState.received(msg); } @Override - public void received(EndOfTurnMessage msg){ + public void received(EndOfTurnMessage msg) { currentState.received(msg); } @Override - public void received(MoveMessage msg){ + public void received(MoveMessage msg) { currentState.received(msg); } - public NoPieceState getNoPiece(){ + public NoPieceState getNoPiece() { return noPieceState; } - public SelectPieceState getSelectPiece(){ + public SelectPieceState getSelectPiece() { return selectPieceState; } - public StartPieceState getStartPiece(){ + public StartPieceState getStartPiece() { return startPieceState; } - public WaitingPieceState getWaitingPiece(){ + public WaitingPieceState getWaitingPiece() { return waitingPieceState; } - public ChoosePieceStates getState(){ + public ChoosePieceStates getState() { return currentState; } - public TurnState getParent(){ + public TurnState getParent() { return parent; } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/MovePieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/MovePieceState.java index 22da0555..5e865e36 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/MovePieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/MovePieceState.java @@ -4,7 +4,10 @@ import pp.mdga.client.ClientState; import pp.mdga.client.gamestate.TurnState; import pp.mdga.message.client.AnimationEndMessage; -import pp.mdga.message.server.*; +import pp.mdga.message.server.CeremonyMessage; +import pp.mdga.message.server.DiceNowMessage; +import pp.mdga.message.server.EndOfTurnMessage; +import pp.mdga.message.server.SpectatorMessage; public class MovePieceState extends TurnStates { @@ -26,27 +29,27 @@ public void exit() { } @Override - public void selectAnimationEnd(){ + public void selectAnimationEnd() { logic.send(new AnimationEndMessage()); } @Override - public void received(CeremonyMessage msg){ + public void received(CeremonyMessage msg) { logic.setState(logic.getCeremony()); } @Override - public void received(EndOfTurnMessage msg){ + public void received(EndOfTurnMessage msg) { parent.getParent().setState(parent.getParent().getWaiting()); } @Override - public void received(SpectatorMessage msg){ + public void received(SpectatorMessage msg) { parent.getParent().setState(parent.getParent().getSpectator()); } @Override - public void received(DiceNowMessage msg){ + public void received(DiceNowMessage msg) { parent.setState(parent.getRollDice()); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PlayPowerCardState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PlayPowerCardState.java index cfd1fb00..3cfb80f1 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PlayPowerCardState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PlayPowerCardState.java @@ -4,8 +4,6 @@ import pp.mdga.client.ClientState; import pp.mdga.client.gamestate.TurnState; import pp.mdga.game.BonusCard; -import pp.mdga.game.card.ShieldCard; -import pp.mdga.game.card.SwapCard; import pp.mdga.message.client.AnimationEndMessage; import pp.mdga.message.server.PlayCardMessage; import pp.mdga.notification.PlayCardNotification; @@ -24,7 +22,7 @@ public PlayPowerCardState(ClientState parent, ClientGameLogic logic) { @Override public void enter() { - if(playCardMessage.getCard().getCard().equals(BonusCard.SWAP)) { + if (playCardMessage.getCard().getCard().equals(BonusCard.SWAP)) { extraAnimationCounter++; } @@ -43,8 +41,8 @@ public void setPlayCard(PlayCardMessage playCardMessage) { } @Override - public void selectAnimationEnd(){ - if(extraAnimationCounter > 0) { + public void selectAnimationEnd() { + if (extraAnimationCounter > 0) { extraAnimationCounter--; return; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PowerCardState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PowerCardState.java index d4892549..aeb6a58b 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PowerCardState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PowerCardState.java @@ -42,7 +42,7 @@ public void exit() { public void setState(PowerCardStates state) { System.out.println("CLIENT STATE old: " + this.state + " new: " + state); - if(this.state != null){ + if (this.state != null) { this.state.exit(); } state.enter(); @@ -50,22 +50,22 @@ public void setState(PowerCardStates state) { } @Override - public void received(PossibleCardsMessage msg){ + public void received(PossibleCardsMessage msg) { state.received(msg); } @Override - public void received(PlayCardMessage msg){ + public void received(PlayCardMessage msg) { state.received(msg); } @Override - public void received(DiceNowMessage msg){ + public void received(DiceNowMessage msg) { state.received(msg); } @Override - public void received(PossiblePieceMessage msg){ + public void received(PossiblePieceMessage msg) { state.received(msg); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java index 47b65669..e756919e 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java @@ -39,43 +39,42 @@ public TurnState getParent() { } @Override - public void selectDice(){ - if (!isRolled){ + public void selectDice() { + if (!isRolled) { isRolled = true; logic.send(new RequestDieMessage()); } } @Override - public void received(DieMessage msg){ + public void received(DieMessage msg) { logic.getGame().setDiceEyes(msg.getDiceEye()); - if(logic.getGame().getTurboFlag()){ + if (logic.getGame().getTurboFlag()) { logic.addNotification(new RollDiceNotification(logic.getGame().getPlayerById(logic.getOwnPlayerId()).getColor(), msg.getDiceEye(), logic.getGame().getDiceModifier())); - } - else { + } else { logic.addNotification(new RollDiceNotification(logic.getGame().getPlayerById(logic.getOwnPlayerId()).getColor(), msg.getDiceEye())); } } @Override - public void selectAnimationEnd(){ + public void selectAnimationEnd() { logic.send(new AnimationEndMessage()); } @Override - public void received(ChoosePieceStateMessage msg){ + public void received(ChoosePieceStateMessage msg) { parent.setState(parent.getChoosePiece()); } @Override - public void received(NoTurnMessage msg){ + public void received(NoTurnMessage msg) { parent.getParent().setState(parent.getParent().getWaiting()); } @Override - public void received(DiceNowMessage msg){ + public void received(DiceNowMessage msg) { isRolled = false; logic.addNotification(new DiceNowNotification()); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/TurnStates.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/TurnStates.java index e7909fb8..8029e9e0 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/TurnStates.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/TurnStates.java @@ -4,7 +4,7 @@ import pp.mdga.client.ClientState; import pp.mdga.client.gamestate.GameStates; -public abstract class TurnStates extends GameStates { +public abstract class TurnStates extends GameStates { public TurnStates(ClientState parent, ClientGameLogic logic) { super(parent, logic); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java index cb462f60..5c1d5006 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java @@ -4,11 +4,11 @@ import pp.mdga.client.ClientState; import pp.mdga.client.gamestate.turnstate.ChoosePieceState; import pp.mdga.game.Piece; -import pp.mdga.message.server.*; +import pp.mdga.message.server.EndOfTurnMessage; +import pp.mdga.message.server.SelectPieceMessage; import pp.mdga.message.server.StartPieceMessage; -import pp.mdga.notification.MovePieceNotification; +import pp.mdga.message.server.WaitPieceMessage; import pp.mdga.notification.SelectableMoveNotification; -import pp.mdga.notification.WaitMoveNotification; import java.util.ArrayList; import java.util.List; @@ -47,7 +47,7 @@ public void received(SelectPieceMessage msg) { } @Override - public void received(WaitPieceMessage msg){ + public void received(WaitPieceMessage msg) { LOGGER.log(System.Logger.Level.INFO, "Received WaitPieceMessage"); Piece piece = logic.getGame().getPieceThroughUUID(msg.getPieceID()); logic.addNotification(new SelectableMoveNotification(new ArrayList<>(List.of(msg.getPieceID())), new ArrayList<>(List.of(logic.getGame().getPlayerByColor(piece.getColor()).getStartNodeIndex())), new ArrayList<>(List.of(false)))); @@ -55,7 +55,7 @@ public void received(WaitPieceMessage msg){ } @Override - public void received(StartPieceMessage msg){ + public void received(StartPieceMessage msg) { Piece piece = logic.getGame().getPieceThroughUUID(msg.getPieceIdentifier()); List listPiece = new ArrayList<>(); List listIndex = new ArrayList<>(); @@ -70,7 +70,7 @@ public void received(StartPieceMessage msg){ } @Override - public void received(EndOfTurnMessage msg){ + public void received(EndOfTurnMessage msg) { logic.getGame().setTurboFlag(false); parent.getParent().getParent().setState(parent.getParent().getParent().getWaiting()); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/SelectPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/SelectPieceState.java index 0e5ec960..d452da5d 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/SelectPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/SelectPieceState.java @@ -4,17 +4,11 @@ import pp.mdga.client.ClientState; import pp.mdga.client.gamestate.turnstate.ChoosePieceState; import pp.mdga.game.Piece; -import pp.mdga.game.ShieldState; import pp.mdga.game.PieceState; +import pp.mdga.game.ShieldState; import pp.mdga.message.client.RequestMoveMessage; -import pp.mdga.message.client.SelectedPiecesMessage; import pp.mdga.message.server.MoveMessage; -import pp.mdga.notification.HomeMoveNotification; -import pp.mdga.notification.MovePieceNotification; -import pp.mdga.notification.RemoveShieldNotification; -import pp.mdga.notification.ShieldActiveNotification; -import pp.mdga.notification.ShieldSuppressedNotification; -import pp.mdga.notification.ThrowPieceNotification; +import pp.mdga.notification.*; import java.util.ArrayList; @@ -63,29 +57,25 @@ public void received(MoveMessage msg) { System.out.println("Client: SelectState: activePiece in Home: infieldIndex" + infieldIndex); if (msg.getTargetIndex() == logic.getGame().getActivePlayer().getHighestHomeIdx()) { piece.setState(PieceState.HOMEFINISHED); - } - else { + } else { piece.setState(PieceState.HOME); } logic.getGame().getBoard().getInfield()[infieldIndex].clearOccupant(); logic.getGame().getPlayerByColor(piece.getColor()).setPieceInHome(msg.getTargetIndex(), piece); - } - else { + } else { System.out.println("Client: SelectPieceState: receivedMoveMessage:reached else"); logic.addNotification(new HomeMoveNotification(piece.getUuid(), msg.getTargetIndex())); System.out.println("Client: electPieceState: homeindex" + logic.getGame().getActivePlayer().getHomeIndexOfPiece(piece)); int pieceHomeIndex = logic.getGame().getActivePlayer().getHomeIndexOfPiece(piece); if (msg.getTargetIndex() == logic.getGame().getActivePlayer().getHighestHomeIdx()) { piece.setState(PieceState.HOMEFINISHED); - } - else { + } else { piece.setState(PieceState.HOME); } logic.getGame().getActivePlayer().getHomeNodes()[pieceHomeIndex].clearOccupant(); logic.getGame().getPlayerByColor(piece.getColor()).setPieceInHome(msg.getTargetIndex(), piece); } - } - else { + } else { int oldIndex = logic.getGame().getBoard().getInfieldIndexOfPiece(piece); Piece occ = logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].getOccupant(); @@ -93,7 +83,7 @@ public void received(MoveMessage msg) { if (occ != null) { //TODO: MoveThrowNotification logic.addNotification(new ThrowPieceNotification(occ.getUuid(), piece.getColor())); - if (occ.isSuppressed()){ + if (occ.isSuppressed()) { logic.addNotification(new RemoveShieldNotification(occ.getUuid())); occ.setShield(ShieldState.NONE); } @@ -111,8 +101,7 @@ public void received(MoveMessage msg) { piece.setShield(ShieldState.SUPPRESSED); logic.addNotification(new ShieldSuppressedNotification(piece.getUuid())); } - } - else if (piece.isSuppressed()) { + } else if (piece.isSuppressed()) { piece.setShield(ShieldState.ACTIVE); logic.addNotification(new ShieldActiveNotification(piece.getUuid())); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/StartPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/StartPieceState.java index 15c86ddd..1e60f45e 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/StartPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/StartPieceState.java @@ -7,15 +7,8 @@ import pp.mdga.game.Piece; import pp.mdga.game.ShieldState; import pp.mdga.message.client.RequestMoveMessage; -import pp.mdga.message.client.SelectedPiecesMessage; import pp.mdga.message.server.MoveMessage; -import pp.mdga.notification.MovePieceNotification; -import pp.mdga.notification.RemoveShieldNotification; -import pp.mdga.notification.ShieldActiveNotification; -import pp.mdga.notification.ShieldSuppressedNotification; -import pp.mdga.notification.ThrowPieceNotification; - -import java.util.ArrayList; +import pp.mdga.notification.*; public class StartPieceState extends ChoosePieceStates { @@ -45,14 +38,14 @@ public void setMoveablePiece(Piece moveablePiece) { } @Override - public void selectPiece(Piece piece){ - if(moveablePiece.equals(piece)){ + public void selectPiece(Piece piece) { + if (moveablePiece.equals(piece)) { logic.send(new RequestMoveMessage(piece)); } } @Override - public void received(MoveMessage msg){ + public void received(MoveMessage msg) { Piece piece = logic.getGame().getPieceThroughUUID(msg.getPiece().getUuid()); int oldIndex = logic.getGame().getBoard().getInfieldIndexOfPiece(piece); int targetIndex = msg.getTargetIndex(); @@ -62,21 +55,21 @@ public void received(MoveMessage msg){ //get Occupant Piece occ = targetNode.getOccupant(); - if (occ != null){ + if (occ != null) { logic.getGame().getPlayerByColor(occ.getColor()).addWaitingPiece(occ); - if (occ.isSuppressed()){ + if (occ.isSuppressed()) { logic.addNotification(new RemoveShieldNotification(occ.getUuid())); occ.setShield(ShieldState.NONE); } logic.addNotification(new ThrowPieceNotification(occ.getUuid(), piece.getColor())); } - if (targetNode.isStart()){ - if (piece.isShielded()){ + if (targetNode.isStart()) { + if (piece.isShielded()) { piece.setShield(ShieldState.SUPPRESSED); logic.addNotification(new ShieldSuppressedNotification(piece.getUuid())); } - } else if (piece.isSuppressed()){ + } else if (piece.isSuppressed()) { piece.setShield(ShieldState.ACTIVE); logic.addNotification(new RemoveShieldNotification(piece.getUuid())); logic.addNotification(new ShieldActiveNotification(piece.getUuid())); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/WaitingPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/WaitingPieceState.java index e80948de..80ec310c 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/WaitingPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/WaitingPieceState.java @@ -7,15 +7,11 @@ import pp.mdga.game.PieceState; import pp.mdga.game.ShieldState; import pp.mdga.message.client.RequestMoveMessage; -import pp.mdga.message.client.SelectedPiecesMessage; import pp.mdga.message.server.MoveMessage; import pp.mdga.notification.MovePieceNotification; import pp.mdga.notification.RemoveShieldNotification; import pp.mdga.notification.ThrowPieceNotification; -import java.util.ArrayList; -import java.util.List; - public class WaitingPieceState extends ChoosePieceStates { private final ChoosePieceState parent; @@ -36,17 +32,17 @@ public void exit() { } @Override - public void selectPiece(Piece piece){ + public void selectPiece(Piece piece) { logic.send(new RequestMoveMessage(piece)); } @Override - public void received(MoveMessage msg){ + public void received(MoveMessage msg) { Piece pieceToMove = logic.getGame().getPieceThroughUUID(msg.getPiece().getUuid()); Piece occ = logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].getOccupant(); - if (occ != null){ + if (occ != null) { logic.getGame().getPlayerByColor(occ.getColor()).addWaitingPiece(occ); - if (occ.isSuppressed()){ + if (occ.isSuppressed()) { logic.addNotification(new RemoveShieldNotification(occ.getUuid())); occ.setShield(ShieldState.NONE); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ChoosePowerCardState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ChoosePowerCardState.java index 7b22da92..3130c8af 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ChoosePowerCardState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ChoosePowerCardState.java @@ -4,9 +4,8 @@ import pp.mdga.client.ClientState; import pp.mdga.client.gamestate.turnstate.PowerCardState; import pp.mdga.game.BonusCard; -import pp.mdga.game.Piece; import pp.mdga.game.Player; -import pp.mdga.game.card.*; +import pp.mdga.game.card.PowerCard; import pp.mdga.message.client.NoPowerCardMessage; import pp.mdga.message.client.SelectCardMessage; import pp.mdga.message.server.DiceNowMessage; @@ -14,7 +13,6 @@ import pp.mdga.message.server.PossibleCardsMessage; import pp.mdga.message.server.PossiblePieceMessage; import pp.mdga.notification.SelectableCardsNotification; -import pp.mdga.notification.SelectableShieldNotification; import java.util.ArrayList; import java.util.stream.Collectors; @@ -29,8 +27,9 @@ public class ChoosePowerCardState extends PowerCardStates { /** * Constructor + * * @param parent parent state - * @param logic game logic + * @param logic game logic */ public ChoosePowerCardState(ClientState parent, ClientGameLogic logic) { super(parent, logic); @@ -54,11 +53,12 @@ public void exit() { /** * Set the possible cards + * * @param msg possible cards message */ @Override - public void received(PossibleCardsMessage msg){ - possibleCards = (ArrayList)msg.getPossibleCards(); + public void received(PossibleCardsMessage msg) { + possibleCards = (ArrayList) msg.getPossibleCards(); ArrayList possibleBonusCards = new ArrayList<>(); for (PowerCard card : possibleCards) { if (!possibleBonusCards.contains(card.getCard())) { @@ -70,15 +70,16 @@ public void received(PossibleCardsMessage msg){ /** * Select a card + * * @param card card to select */ @Override - public void selectCard(BonusCard card){ + public void selectCard(BonusCard card) { Player player = logic.getGame().getPlayers().get(logic.getOwnPlayerId()); ArrayList handCards = player.getHandCards(); - if(card != null){ + if (card != null) { PowerCard select = player.getPowerCardByType(card); - if(select == null){ + if (select == null) { select = select; } logic.send(new SelectCardMessage(select)); @@ -89,11 +90,12 @@ public void selectCard(BonusCard card){ /** * Receive a card + * * @param msg card message */ @Override - public void received(PlayCardMessage msg){ - if(msg.getCard().getCard().equals(BonusCard.TURBO)){ + public void received(PlayCardMessage msg) { + if (msg.getCard().getCard().equals(BonusCard.TURBO)) { logic.getGame().setDiceModifier(msg.getDiceModifier()); parent.getParent().getPlayPowerCard().setPlayCard(msg); logic.getGame().setTurboFlag(true); @@ -103,20 +105,22 @@ public void received(PlayCardMessage msg){ /** * Receive a die now message + * * @param msg dice now message */ @Override - public void received(DiceNowMessage msg){ + public void received(DiceNowMessage msg) { parent.getParent().setState(parent.getParent().getRollDice()); } /** * Receive a possible piece message and decide if the player can swap or shield + * * @param msg possible piece message */ @Override - public void received(PossiblePieceMessage msg){ - if (msg.getEnemyPossiblePieces().isEmpty()){ + public void received(PossiblePieceMessage msg) { + if (msg.getEnemyPossiblePieces().isEmpty()) { parent.getShield().setPossiblePieces(msg.getOwnPossiblePieces().stream().map(piece -> logic.getGame().getPieceThroughUUID(piece.getUuid())).collect(Collectors.toCollection(ArrayList::new))); parent.setState(parent.getShield()); } else { diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ShieldState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ShieldState.java index 87882f2a..f7df51eb 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ShieldState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ShieldState.java @@ -4,14 +4,12 @@ import pp.mdga.client.ClientState; import pp.mdga.client.gamestate.turnstate.PowerCardState; import pp.mdga.game.Piece; -import pp.mdga.message.client.RequestPlayCardMessage; import pp.mdga.message.client.SelectedPiecesMessage; import pp.mdga.message.server.PlayCardMessage; import pp.mdga.notification.SelectableShieldNotification; import java.lang.System.Logger.Level; import java.util.ArrayList; -import java.util.List; public class ShieldState extends PowerCardStates { diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/SwapState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/SwapState.java index 12cbd965..6d6e40dc 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/SwapState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/SwapState.java @@ -4,14 +4,12 @@ import pp.mdga.client.ClientState; import pp.mdga.client.gamestate.turnstate.PowerCardState; import pp.mdga.game.Piece; -import pp.mdga.message.client.RequestPlayCardMessage; -import pp.mdga.message.client.SelectCardMessage; import pp.mdga.message.client.SelectedPiecesMessage; import pp.mdga.message.server.PlayCardMessage; import pp.mdga.notification.SelectableSwapNotification; -import java.util.UUID; import java.util.ArrayList; +import java.util.UUID; public class SwapState extends PowerCardStates { @@ -59,17 +57,17 @@ public void setPossibleEnemyPieces(ArrayList possibleEnemyPieces) { } @Override - public void selectPiece(Piece piece){ - if (possibleOwnPieces.contains(piece)){ + public void selectPiece(Piece piece) { + if (possibleOwnPieces.contains(piece)) { selectedOwnPiece = piece; - } else if (possibleEnemyPieces.contains(piece)){ + } else if (possibleEnemyPieces.contains(piece)) { selectedEnemyPiece = piece; } - if (selectedOwnPiece != null && selectedEnemyPiece != null){ + if (selectedOwnPiece != null && selectedEnemyPiece != null) { ArrayList temp = new ArrayList<>(); temp.add(selectedOwnPiece); temp.add(selectedEnemyPiece); - System.out.println("Client : Swap: temp: "+temp.get(0)+temp.get(1)); + System.out.println("Client : Swap: temp: " + temp.get(0) + temp.get(1)); logic.send(new SelectedPiecesMessage(temp)); selectedEnemyPiece = null; selectedOwnPiece = null; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/Board.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/Board.java index fed99575..e1d0b0ac 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/Board.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/Board.java @@ -79,7 +79,7 @@ private StartNode createStartNode(int i) { */ public int getInfieldIndexOfPiece(Piece piece) { for (int i = 0; i < infield.length; i++) { - if(infield[i].isOccupied()) { + if (infield[i].isOccupied()) { if (infield[i].getOccupant().equals(piece)) { return i; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/Color.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/Color.java index bfc5bb8d..79e677fe 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/Color.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/Color.java @@ -53,8 +53,8 @@ public static Color getColorByIndex(int index) { public Color next(Game game) { ArrayList colorsInGame = new ArrayList<>(); - for(Player p : game.getPlayers().values()) { - if(p.isFinished()) { + for (Player p : game.getPlayers().values()) { + if (p.isFinished()) { continue; } colorsInGame.add(p.getColor()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java index f2e23bcc..f2d58eda 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java @@ -109,7 +109,7 @@ private void initializeDrawPile() { */ public PowerCard draw() { if (!this.drawPile.isEmpty()) { - if (drawPile.size() == 1){ + if (drawPile.size() == 1) { Collections.shuffle(this.discardPile); this.drawPile.addAll(this.discardPile); discardPile.clear(); @@ -221,7 +221,7 @@ public Player getPlayerByColor(Color color) { * * @return the active player */ - public Player getActivePlayer(){ + public Player getActivePlayer() { return getPlayerByColor(activeColor); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/Node.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/Node.java index 604ef1cd..6433a83a 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/Node.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/Node.java @@ -46,7 +46,7 @@ public void setOccupant(Piece occupant) { this.occupant = occupant; } - public boolean isBonus(){ + public boolean isBonus() { return false; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/Piece.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/Piece.java index 3335f81a..6a3d3e1f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/Piece.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/Piece.java @@ -2,7 +2,6 @@ import com.jme3.network.serializing.Serializable; -import java.util.Objects; import java.util.UUID; /** diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/Player.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/Player.java index bd7f14f6..35cc31ca 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/Player.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/Player.java @@ -147,7 +147,7 @@ public boolean isFinished() { */ public PowerCard getPowerCardByType(BonusCard bonusCard) { for (PowerCard card : this.handCards) { - if(card.getCard().equals(bonusCard)) { + if (card.getCard().equals(bonusCard)) { return card; } } @@ -155,9 +155,9 @@ public PowerCard getPowerCardByType(BonusCard bonusCard) { // throw new RuntimeException("bonusCard is not in handCards"); } - public Piece getWaitingPiece(){ + public Piece getWaitingPiece() { for (Piece piece : this.waitingArea) { - if (piece != null){ + if (piece != null) { return piece; } } @@ -170,9 +170,9 @@ public Piece getWaitingPiece(){ * * @return the boolean if the waiting area contains a piece */ - public boolean hasPieceInWaitingArea(){ + public boolean hasPieceInWaitingArea() { for (Piece piece : this.waitingArea) { - if (piece != null){ + if (piece != null) { return true; } } @@ -211,10 +211,10 @@ public boolean isHomeFinished(Piece piece) { * * @return the index */ - public int getHighestHomeIdx(){ - for (int i =3; i>=0;i--){ - if(!homeNodes[i].isOccupied()) { - System.out.println("Player: highestHomeIndex:"+i); + public int getHighestHomeIdx() { + for (int i = 3; i >= 0; i--) { + if (!homeNodes[i].isOccupied()) { + System.out.println("Player: highestHomeIndex:" + i); return i; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/card/ShieldCard.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/card/ShieldCard.java index 07d9afa7..afa42156 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/card/ShieldCard.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/card/ShieldCard.java @@ -15,6 +15,7 @@ public class ShieldCard extends PowerCard { public ShieldCard() { this.card = BonusCard.SHIELD; } + /** * This method will be used to call the visit method of the given visitor parameter and pass a PowerCard object. * diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/client/JoinedLobbyMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/client/JoinedLobbyMessage.java index c87704db..eb7c47fe 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/client/JoinedLobbyMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/client/JoinedLobbyMessage.java @@ -33,7 +33,7 @@ public JoinedLobbyMessage() { * * @return the name of the player that is joining the server */ - public String getName(){ + public String getName() { return name; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/CeremonyMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/CeremonyMessage.java index 595baff1..12d80d3a 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/CeremonyMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/CeremonyMessage.java @@ -19,6 +19,7 @@ public class CeremonyMessage extends ServerMessage { private ArrayList sixes; private ArrayList nodesMoved; private ArrayList bonusNodes; + /** * Constructs a new Ceremony instance. */ diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/ChoosePieceStateMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/ChoosePieceStateMessage.java index 580aef17..d3ad7de4 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/ChoosePieceStateMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/ChoosePieceStateMessage.java @@ -8,6 +8,7 @@ public class ChoosePieceStateMessage extends ServerMessage { public ChoosePieceStateMessage() { super(); } + /** * Accepts a visitor to process this message. * diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DieMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DieMessage.java index 9d9c8708..fe0ecd9d 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DieMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DieMessage.java @@ -2,8 +2,6 @@ import com.jme3.network.serializing.Serializable; -import java.util.List; - /** * A message sent by the server to the client to inform about the dice roll. */ diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DrawCardMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DrawCardMessage.java index c26f561d..da0fb51e 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DrawCardMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DrawCardMessage.java @@ -4,16 +4,16 @@ import pp.mdga.game.card.PowerCard; @Serializable -public class DrawCardMessage extends ServerMessage{ +public class DrawCardMessage extends ServerMessage { private final PowerCard card; - public DrawCardMessage(PowerCard card){ + public DrawCardMessage(PowerCard card) { super(); this.card = card; } - private DrawCardMessage(){ + private DrawCardMessage() { super(); card = null; } @@ -28,12 +28,12 @@ public void accept(ServerInterpreter interpreter) { interpreter.received(this); } - public PowerCard getCard(){ + public PowerCard getCard() { return card; } @Override public String toString() { - return "DrawCardMessage{" + "PowerCard=" + card +'}'; + return "DrawCardMessage{" + "PowerCard=" + card + '}'; } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/IncorrectRequestMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/IncorrectRequestMessage.java index 79fe528e..05bc89d6 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/IncorrectRequestMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/IncorrectRequestMessage.java @@ -32,7 +32,7 @@ public IncorrectRequestMessage() { * * @return the id of the error message */ - public int getId(){ + public int getId() { return id; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/LobbyPlayerLeaveMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/LobbyPlayerLeaveMessage.java index 3c6bbba2..d698aa53 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/LobbyPlayerLeaveMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/LobbyPlayerLeaveMessage.java @@ -1,7 +1,6 @@ package pp.mdga.message.server; import com.jme3.network.serializing.Serializable; -import pp.mdga.game.Color; /** * A message sent by the server to indicate that a player has left the lobby. diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/MoveMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/MoveMessage.java index b40ae2eb..45712b3f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/MoveMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/MoveMessage.java @@ -3,8 +3,6 @@ import com.jme3.network.serializing.Serializable; import pp.mdga.game.Piece; -import java.util.UUID; - /** * A message sent by the server to the client to move a piece on the board. */ @@ -28,8 +26,8 @@ public class MoveMessage extends ServerMessage { /** * Constructs a new MoveMessage instance. * - * @param piece the identifier of the piece that should be moved - * @param isHomeMove boolean flag declaring home move or not + * @param piece the identifier of the piece that should be moved + * @param isHomeMove boolean flag declaring home move or not * @param targetIndex the targetIndex */ public MoveMessage(Piece piece, boolean isHomeMove, int targetIndex) { diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/PossiblePieceMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/PossiblePieceMessage.java index 68bc2172..117ac11c 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/PossiblePieceMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/PossiblePieceMessage.java @@ -3,10 +3,8 @@ import com.jme3.network.serializing.Serializable; import pp.mdga.game.Piece; -import java.io.PipedOutputStream; import java.util.ArrayList; import java.util.List; -import java.util.UUID; /** * A message sent by the server to the active player to give all possible pieces to choose from. diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/SelectPieceMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/SelectPieceMessage.java index 550645ac..1c9635e4 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/SelectPieceMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/SelectPieceMessage.java @@ -1,9 +1,9 @@ package pp.mdga.message.server; import com.jme3.network.serializing.Serializable; +import pp.mdga.game.Piece; import java.util.List; -import pp.mdga.game.Piece; /** * A message sent by the server to the active player to select a piece to move. diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/AcquireCardNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/AcquireCardNotification.java index fdff397a..4640ca20 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/AcquireCardNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/AcquireCardNotification.java @@ -2,12 +2,10 @@ import pp.mdga.game.BonusCard; -import java.util.UUID; - /** * Notification that is sent when a card is acquired. */ -public class AcquireCardNotification extends Notification{ +public class AcquireCardNotification extends Notification { private BonusCard bonusCard; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/FinishNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/FinishNotification.java index d51a843f..81009b24 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/FinishNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/FinishNotification.java @@ -2,10 +2,10 @@ import pp.mdga.game.Color; -public class FinishNotification extends Notification{ +public class FinishNotification extends Notification { private Color colorFinished; - public FinishNotification(Color colorFinished){ + public FinishNotification(Color colorFinished) { this.colorFinished = colorFinished; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/GameNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/GameNotification.java index 1c6e79fa..cda64ff0 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/GameNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/GameNotification.java @@ -5,7 +5,7 @@ /** * GameNotification class */ -public class GameNotification extends Notification{ +public class GameNotification extends Notification { private final Color ownColor; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/InfoNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/InfoNotification.java index c13c9e18..b7f1de1e 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/InfoNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/InfoNotification.java @@ -3,7 +3,7 @@ /** * Notification that is to give information to the player. */ -public class InfoNotification extends Notification{ +public class InfoNotification extends Notification { private final String message; @@ -28,5 +28,7 @@ public String getMessage() { return message; } - public boolean isError() { return isError; } + public boolean isError() { + return isError; + } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/LobbyReadyNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/LobbyReadyNotification.java index eeccd24f..fd679c55 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/LobbyReadyNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/LobbyReadyNotification.java @@ -2,7 +2,7 @@ import pp.mdga.game.Color; -public class LobbyReadyNotification extends Notification{ +public class LobbyReadyNotification extends Notification { /** * The color of the player. diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/MovePieceNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/MovePieceNotification.java index 455c6baa..dd8b4bfc 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/MovePieceNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/MovePieceNotification.java @@ -31,9 +31,9 @@ public class MovePieceNotification extends Notification { /** * Constructs a notification for a piece start movement. * - * @param piece the unique identifier of the piece - * @param moveIndex the destination node index - * @param moveStart whether to ignore {@code startIndex} and use {@code moveIndex} as the start node + * @param piece the unique identifier of the piece + * @param moveIndex the destination node index + * @param moveStart whether to ignore {@code startIndex} and use {@code moveIndex} as the start node */ public MovePieceNotification(UUID piece, int moveIndex, boolean moveStart) { this.piece = piece; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/RankingResponceNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/RankingResponceNotification.java index fd39acc6..711c5d4f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/RankingResponceNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/RankingResponceNotification.java @@ -1,13 +1,12 @@ package pp.mdga.notification; import pp.mdga.game.Color; -import pp.mdga.message.server.ServerMessage; -import java.util.HashMap; import java.util.Map; public class RankingResponceNotification extends Notification { private final Map rankingResults; + /** * Constructor. * diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/RollDiceNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/RollDiceNotification.java index dfc5daf3..8e12c1e8 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/RollDiceNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/RollDiceNotification.java @@ -5,7 +5,7 @@ /** * Notification that a die has been rolled. */ -public class RollDiceNotification extends Notification{ +public class RollDiceNotification extends Notification { private Color color; private int eyes; @@ -14,10 +14,12 @@ public class RollDiceNotification extends Notification{ private boolean isRanking; //normal + /** * Constructor. + * * @param color the color of the player that rolled the die. - * @param eyes the number of eyes that were rolled. + * @param eyes the number of eyes that were rolled. */ public RollDiceNotification(Color color, int eyes) { this.color = color; @@ -47,6 +49,7 @@ public RollDiceNotification(Color color, int eyes, int multiplier) { /** * Get the color of the player that rolled the die. + * * @return the color of the player that rolled the die. */ public Color getColor() { @@ -55,6 +58,7 @@ public Color getColor() { /** * Get the number of eyes that were rolled. + * * @return the number of eyes that were rolled. */ public int getEyes() { @@ -69,5 +73,7 @@ public boolean isTurbo() { return turbo; } - public boolean isRanking() { return isRanking; } + public boolean isRanking() { + return isRanking; + } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableCardsNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableCardsNotification.java index efcbc37e..89a9d60e 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableCardsNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableCardsNotification.java @@ -1,6 +1,7 @@ package pp.mdga.notification; import pp.mdga.game.BonusCard; + import java.util.List; /** @@ -14,6 +15,7 @@ public class SelectableCardsNotification extends Notification { /** * Constructor. + * * @param cards The list of cards that the player can choose from. */ public SelectableCardsNotification(List cards) { @@ -22,6 +24,7 @@ public SelectableCardsNotification(List cards) { /** * Get the list of cards that the player can choose from. + * * @return The list of cards that the player can choose from. */ public List getCards() { diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableMoveNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableMoveNotification.java index ce1ca590..e9ac6301 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableMoveNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableMoveNotification.java @@ -26,9 +26,9 @@ public class SelectableMoveNotification extends Notification { /** * Constructs a notification for selectable piece moves. * - * @param pieces the list of pieces that can be moved + * @param pieces the list of pieces that can be moved * @param moveIndices the list of target nodes for the moves - * @param homeMoves the list indicating if the target nodes are in the home area + * @param homeMoves the list indicating if the target nodes are in the home area */ public SelectableMoveNotification(List pieces, List moveIndices, List homeMoves) { this.pieces = pieces; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableShieldNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableShieldNotification.java index f0a9982d..53c11982 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableShieldNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/SelectableShieldNotification.java @@ -3,10 +3,10 @@ import java.util.List; import java.util.UUID; -public class SelectableShieldNotification extends Notification{ +public class SelectableShieldNotification extends Notification { private List pieces; - public SelectableShieldNotification(List pieces){ + public SelectableShieldNotification(List pieces) { this.pieces = pieces; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/TurboActiveNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/TurboActiveNotification.java index 890f2451..f31a6430 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/TurboActiveNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/TurboActiveNotification.java @@ -1,4 +1,4 @@ package pp.mdga.notification; -public class TurboActiveNotification extends Notification{ +public class TurboActiveNotification extends Notification { } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/ServerGameLogic.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/ServerGameLogic.java index be16512e..473e46a4 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/ServerGameLogic.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/ServerGameLogic.java @@ -9,7 +9,7 @@ /** * */ -public class ServerGameLogic implements ClientInterpreter { +public class ServerGameLogic implements ClientInterpreter { /** * Constants. */ diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/CeremonyState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/CeremonyState.java index 2323c28d..3f444ad1 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/CeremonyState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/CeremonyState.java @@ -2,7 +2,6 @@ import pp.mdga.game.Color; import pp.mdga.message.server.CeremonyMessage; -import pp.mdga.notification.CeremonyNotification; import pp.mdga.server.ServerGameLogic; /** @@ -28,9 +27,9 @@ public CeremonyState(ServerGameLogic logic) { * * @return the created CeremonyNotification */ - private CeremonyMessage createCeremonyMessage(){ + private CeremonyMessage createCeremonyMessage() { CeremonyMessage message = new CeremonyMessage(); - for (var player : logic.getGame().getPlayerRanking().entrySet()){ + for (var player : logic.getGame().getPlayerRanking().entrySet()) { message.getColors().add(player.getValue().getColor()); message.getNames().add(player.getValue().getName()); message.getSixes().add(player.getValue().getPlayerStatistic().getDiced6()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/GameState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/GameState.java index 4d856635..0e28edf5 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/GameState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/GameState.java @@ -3,9 +3,9 @@ import pp.mdga.message.client.*; import pp.mdga.message.server.CeremonyMessage; import pp.mdga.message.server.PauseGameMessage; +import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.game.AnimationState; import pp.mdga.server.automaton.game.DetermineStartPlayerState; -import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.game.GameAutomatonState; import pp.mdga.server.automaton.game.TurnState; @@ -86,15 +86,15 @@ public void received(LeaveGameMessage msg, int from) { } @Override - public void received(NoPowerCardMessage msg, int from){ + public void received(NoPowerCardMessage msg, int from) { this.currentState.received(msg, from); } - public void received(SelectCardMessage msg, int from){ + public void received(SelectCardMessage msg, int from) { currentState.received(msg, from); } - public void received(RequestMoveMessage msg, int from){ + public void received(RequestMoveMessage msg, int from) { this.currentState.received(msg, from); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/LobbyState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/LobbyState.java index 2e7fa72a..4f4566e6 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/LobbyState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/LobbyState.java @@ -4,10 +4,6 @@ import pp.mdga.game.Piece; import pp.mdga.game.PieceState; import pp.mdga.game.Player; -import pp.mdga.game.card.PowerCard; -import pp.mdga.game.card.ShieldCard; -import pp.mdga.game.card.SwapCard; -import pp.mdga.game.card.TurboCard; import pp.mdga.message.client.*; import pp.mdga.message.server.*; import pp.mdga.server.ServerGameLogic; @@ -98,8 +94,7 @@ public void received(SelectTSKMessage msg, int from) { this.logic.getServerSender().broadcast(new UpdateTSKMessage(from, Color.NONE, false)); this.logic.getGame().getPlayerById(from).setColor(msg.getColor()); this.logic.getServerSender().broadcast(new UpdateTSKMessage(from, msg.getColor(), true)); - } - else { + } else { this.logic.getServerSender().send(from, new IncorrectRequestMessage(0)); } } @@ -132,8 +127,7 @@ public void received(LobbyReadyMessage msg, int from) { if (color != Color.NONE) { this.logic.getGame().getPlayerById(from).setColor(color); this.logic.getServerSender().broadcast(new UpdateTSKMessage(from, color, true)); - } - else { + } else { this.logic.getServerSender().send(from, new IncorrectRequestMessage(1)); } } @@ -171,8 +165,7 @@ public void received(StartGameMessage msg, int from) { } else { this.logic.getServerSender().send(from, new IncorrectRequestMessage(6)); } - } - else { + } else { this.logic.getServerSender().send(from, new IncorrectRequestMessage(5)); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/ServerState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/ServerState.java index 0a718927..46879df1 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/ServerState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/ServerState.java @@ -41,7 +41,8 @@ public ServerState(ServerGameLogic logic) { * @param msg as the message which was sent by the player as a AnimationEndMessage object. * @param from as the client id of the player as an Integer. */ - public void received(AnimationEndMessage msg, int from) {} + public void received(AnimationEndMessage msg, int from) { + } /** * This method will be called whenever the server received a DeselectTSKMessage message. @@ -50,7 +51,8 @@ public void received(AnimationEndMessage msg, int from) {} * @param msg as the message which was sent by the player as a DeselectTSKMessage object. * @param from as the client id of the player as an Integer. */ - public void received(DeselectTSKMessage msg, int from) {} + public void received(DeselectTSKMessage msg, int from) { + } /** * This method will be called whenever the server received a StartGame message. @@ -59,7 +61,8 @@ public void received(DeselectTSKMessage msg, int from) {} * @param msg as the message which was sent by the player as a StartGame object. * @param from as the client id of the player as an Integer. */ - public void received(StartGameMessage msg, int from) {} + public void received(StartGameMessage msg, int from) { + } /** * This method will be called whenever the server received a JoinedLobbyMessage message. @@ -68,7 +71,8 @@ public void received(StartGameMessage msg, int from) {} * @param msg as the message which was sent by the player as a JoinedLobbyMessage object. * @param from as the client id of the player as an Integer. */ - public void received(JoinedLobbyMessage msg, int from) {} + public void received(JoinedLobbyMessage msg, int from) { + } /** * This method will be called whenever the server received an LeaveGameMessage message. @@ -94,7 +98,8 @@ public void received(LeaveGameMessage msg, int from) { * @param msg as the message which was sent by the player as a LobbyReadyMessage object. * @param from as the client id of the player as an Integer. */ - public void received(LobbyReadyMessage msg, int from) {} + public void received(LobbyReadyMessage msg, int from) { + } /** * This method will be called whenever the server received a LobbyNotReadyMessage message. @@ -103,7 +108,8 @@ public void received(LobbyReadyMessage msg, int from) {} * @param msg as the message which was sent by the player as a LobbyNotReadyMessage object. * @param from as the client id of the player as an Integer. */ - public void received(LobbyNotReadyMessage msg, int from) {} + public void received(LobbyNotReadyMessage msg, int from) { + } /** * This method will be called whenever the server received a DisconnectedMessage message. @@ -112,7 +118,8 @@ public void received(LobbyNotReadyMessage msg, int from) {} * @param msg as the message which was sent by the player as a DisconnectedMessage object. * @param from as the client id of the player as an Integer. */ - public void received(DisconnectedMessage msg, int from) {} + public void received(DisconnectedMessage msg, int from) { + } /** * This method will be called whenever the server received a RequestBriefingMessage message. @@ -121,7 +128,8 @@ public void received(DisconnectedMessage msg, int from) {} * @param msg as the message which was sent by the player as a RequestBriefingMessage object. * @param from as the client id of the player as an Integer. */ - public void received(RequestBriefingMessage msg, int from) {} + public void received(RequestBriefingMessage msg, int from) { + } /** * This method will be called whenever the server received a RequestDieMessage message. @@ -130,7 +138,8 @@ public void received(RequestBriefingMessage msg, int from) {} * @param msg as the message which was sent by the player as a RequestDieMessage object. * @param from as the client id of the player as an Integer. */ - public void received(RequestDieMessage msg, int from) {} + public void received(RequestDieMessage msg, int from) { + } /** * This method will be called whenever the server received a RequestMoveMessage message. @@ -139,7 +148,8 @@ public void received(RequestDieMessage msg, int from) {} * @param msg as the message which was sent by the player as a RequestMoveMessage object. * @param from as the client id of the player as an Integer. */ - public void received(RequestMoveMessage msg, int from) {} + public void received(RequestMoveMessage msg, int from) { + } /** * This method will be called whenever the server received a RequestPlayCardMessage message. @@ -148,7 +158,8 @@ public void received(RequestMoveMessage msg, int from) {} * @param msg as the message which was sent by the player as a RequestPlayCardMessage object. * @param from as the client id of the player as an Integer. */ - public void received(RequestPlayCardMessage msg, int from) {} + public void received(RequestPlayCardMessage msg, int from) { + } /** * This method will be called whenever the server received a SelectCardMessage message. @@ -157,7 +168,8 @@ public void received(RequestPlayCardMessage msg, int from) {} * @param msg as the message which was sent by the player as a SelectCardMessage object. * @param from as the client id of the player as an Integer. */ - public void received(SelectCardMessage msg, int from) {} + public void received(SelectCardMessage msg, int from) { + } /** * This method will be called whenever the server received a SelectTSKMessage message. @@ -166,7 +178,8 @@ public void received(SelectCardMessage msg, int from) {} * @param msg as the message which was sent by the player as a SelectTSKMessage object. * @param from as the client id of the player as an Integer. */ - public void received(SelectTSKMessage msg, int from) {} + public void received(SelectTSKMessage msg, int from) { + } /** * This method will be called whenever the server received a ForceContinueGameMessage message. @@ -175,7 +188,8 @@ public void received(SelectTSKMessage msg, int from) {} * @param msg as the message which was sent by the player as a ForceContinueGameMessage object. * @param from as the client id of the player as an Integer. */ - public void received(ForceContinueGameMessage msg, int from) {} + public void received(ForceContinueGameMessage msg, int from) { + } /** * This method will be called whenever the server received a ClientStartGameMessage message. @@ -184,7 +198,8 @@ public void received(ForceContinueGameMessage msg, int from) {} * @param msg as the message which was sent by the player as a ClientStartGameMessage object. * @param from as the client id of the player as an Integer. */ - public void received(ClientStartGameMessage msg, int from) {} + public void received(ClientStartGameMessage msg, int from) { + } /** * This method will be called whenever the server received a NoPowerCardMessage message. @@ -193,7 +208,8 @@ public void received(ClientStartGameMessage msg, int from) {} * @param msg as the message which was sent by the player as a NoPowerCardMessage object. * @param from as the client id of the player as an Integer. */ - public void received(NoPowerCardMessage msg, int from) {} + public void received(NoPowerCardMessage msg, int from) { + } /** * This method will be called whenever the server received a SelectedPiecesMessage message. @@ -202,5 +218,6 @@ public void received(NoPowerCardMessage msg, int from) {} * @param msg as the message which was sent by the player as a SelectedPiecesMessage object. * @param from as the client id of the player as an Integer. */ - public void received(SelectedPiecesMessage msg, int from) {} + public void received(SelectedPiecesMessage msg, int from) { + } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/DetermineStartPlayerState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/DetermineStartPlayerState.java index d1481445..ef649e38 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/DetermineStartPlayerState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/DetermineStartPlayerState.java @@ -6,19 +6,12 @@ import pp.mdga.message.server.ActivePlayerMessage; import pp.mdga.message.server.DiceNowMessage; import pp.mdga.message.server.DieMessage; -import pp.mdga.message.server.EndOfTurnMessage; import pp.mdga.message.server.RankingResponseMessage; import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.GameState; import java.lang.System.Logger.Level; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Logger; +import java.util.*; public class DetermineStartPlayerState extends GameAutomatonState { /** @@ -32,7 +25,7 @@ public class DetermineStartPlayerState extends GameAutomatonState { private final Map diceResults = new HashMap<>(); private final Map finalDiceResults = new HashMap<>(); private final List playersHaveToRoll = new ArrayList<>(); - private final Set messageReceived = new HashSet<>();; + private final Set messageReceived = new HashSet<>(); private int playerToStart; /** @@ -77,8 +70,7 @@ public void received(RequestDieMessage msg, int from) { if (maximumRoll == entry.getValue()) { this.playersHaveToRoll.add(entry.getKey()); LOGGER.log(Level.INFO, "Players have to roll(RD same as maximum): {0}", this.playersHaveToRoll.size()); - } - else if (maximumRoll < entry.getValue()) { + } else if (maximumRoll < entry.getValue()) { maximumRoll = entry.getValue(); this.playersHaveToRoll.clear(); this.playersHaveToRoll.add(entry.getKey()); @@ -109,8 +101,7 @@ public void received(AnimationEndMessage msg, int from) { } finalDiceResults.putAll(this.diceResults); diceResults.clear(); - } - else { + } else { finalDiceResults.putAll(this.diceResults); LOGGER.log(Level.INFO, "Players have to roll: %s".formatted(this.logic.getGame().getPlayerById(this.playersHaveToRoll.get(0)))); Color color = this.logic.getGame().getPlayerById(this.playersHaveToRoll.get(0)).getColor(); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/TurnState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/TurnState.java index 18a6d457..e8b07dc5 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/TurnState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/TurnState.java @@ -6,12 +6,7 @@ import pp.mdga.message.client.*; import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.GameState; -import pp.mdga.server.automaton.game.turn.ChoosePieceState; -import pp.mdga.server.automaton.game.turn.MovePieceState; -import pp.mdga.server.automaton.game.turn.PlayPowerCardState; -import pp.mdga.server.automaton.game.turn.PowerCardState; -import pp.mdga.server.automaton.game.turn.RollDiceState; -import pp.mdga.server.automaton.game.turn.TurnAutomatonState; +import pp.mdga.server.automaton.game.turn.*; import java.lang.System.Logger.Level; @@ -118,7 +113,7 @@ public void received(AnimationEndMessage msg, int from) { this.currentState.received(msg, from); } - public void received(SelectCardMessage msg, int from){ + public void received(SelectCardMessage msg, int from) { currentState.received(msg, from); } @@ -195,7 +190,7 @@ public void setCurrentState(TurnAutomatonState state) { if (this.currentState != null) { this.currentState.exit(); } - System.out.println("Server: the server entered:"+state); + System.out.println("Server: the server entered:" + state); this.currentState = state; this.currentState.enter(); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/MovePieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/MovePieceState.java index adf63b8e..c12c89ad 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/MovePieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/MovePieceState.java @@ -4,7 +4,6 @@ import pp.mdga.game.Player; import pp.mdga.message.client.AnimationEndMessage; import pp.mdga.message.server.ActivePlayerMessage; -import pp.mdga.message.server.CeremonyMessage; import pp.mdga.message.server.DiceNowMessage; import pp.mdga.message.server.EndOfTurnMessage; import pp.mdga.message.server.SpectatorMessage; @@ -43,20 +42,20 @@ private void setActivePlayer(Color activePlayer) { } @Override - public void received(AnimationEndMessage msg, int from){ + public void received(AnimationEndMessage msg, int from) { finishedAnimations.add(logic.getGame().getPlayerById(from)); if (finishedAnimations.size() == logic.getGame().getPlayers().size()) { - if (logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).isFinished()){ + if (logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).isFinished()) { logic.getGame().getPlayerRanking().put(logic.getGame().getPlayerRanking().size(), logic.getGame().getActivePlayer()); logic.getServerSender().send(logic.getGame().getPlayerIdByColor(logic.getGame().getActiveColor()), new SpectatorMessage()); setActivePlayer(logic.getGame().getActiveColor()); - if (logic.getGame().getPlayerRanking().size() == logic.getGame().getPlayers().size() - 1){ + if (logic.getGame().getPlayerRanking().size() == logic.getGame().getPlayers().size() - 1) { logic.getGame().getPlayerRanking().put(logic.getGame().getPlayerRanking().size(), logic.getGame().getActivePlayer()); logic.setCurrentState(logic.getCeremonyState()); return; } this.turnAutomaton.getGameAutomaton().setCurrentState(this.turnAutomaton.getGameAutomaton().getTurnState()); - } else if (logic.getGame().getDiceEyes() == 6){ + } else if (logic.getGame().getDiceEyes() == 6) { logic.getServerSender().send(logic.getGame().getPlayerIdByColor(logic.getGame().getActiveColor()), new DiceNowMessage()); this.turnAutomaton.setCurrentState(this.turnAutomaton.getRollDiceState()); } else { diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/PlayPowerCardState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/PlayPowerCardState.java index 0c3c0dda..a70bd9d3 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/PlayPowerCardState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/PlayPowerCardState.java @@ -3,7 +3,6 @@ import pp.mdga.message.client.AnimationEndMessage; import pp.mdga.message.server.DiceNowMessage; import pp.mdga.server.ServerGameLogic; -import pp.mdga.server.automaton.game.AnimationState; import pp.mdga.server.automaton.game.TurnState; import java.util.HashSet; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/PowerCardState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/PowerCardState.java index 5d2fa745..22edc79f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/PowerCardState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/PowerCardState.java @@ -10,11 +10,7 @@ import pp.mdga.message.server.PossibleCardsMessage; import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.game.TurnState; -import pp.mdga.server.automaton.game.turn.powercard.ChoosePowerCardState; -import pp.mdga.server.automaton.game.turn.powercard.PowerCardAutomatonState; -import pp.mdga.server.automaton.game.turn.powercard.ShieldCardState; -import pp.mdga.server.automaton.game.turn.powercard.SwapCardState; -import pp.mdga.server.automaton.game.turn.powercard.TurboCardState; +import pp.mdga.server.automaton.game.turn.powercard.*; import pp.mdga.visitor.ServerCardVisitor; import java.util.HashSet; @@ -41,7 +37,7 @@ public class PowerCardState extends TurnAutomatonState { private ServerCardVisitor visitor; private PowerCard selectedCard; private final Set selectedPieces = new HashSet<>(); - private final Set chekedCards = new HashSet<>(); + private final Set chekedCards = new HashSet<>(); /** * Constructs a server state of the specified game logic. @@ -74,8 +70,7 @@ public void enter() { if (this.visitor.getCards().isEmpty()) { this.logic.getServerSender().send(this.logic.getGame().getActivePlayerId(), new DiceNowMessage()); this.turnAutomaton.setCurrentState(this.turnAutomaton.getRollDiceState()); - } - else { + } else { this.logic.getServerSender().send(this.logic.getGame().getActivePlayerId(), new PossibleCardsMessage(this.visitor.getCards())); } } @@ -86,7 +81,7 @@ public void exit() { } @Override - public void received(NoPowerCardMessage msg, int form){ + public void received(NoPowerCardMessage msg, int form) { currentState.received(msg, form); } @@ -100,7 +95,7 @@ public void addSelectedPiece(Piece piece) { this.selectedPieces.add(piece); } - public void received(SelectCardMessage msg, int from){ + public void received(SelectCardMessage msg, int from) { currentState.received(msg, from); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/RollDiceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/RollDiceState.java index 225c79a0..5dc8823a 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/RollDiceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/RollDiceState.java @@ -40,7 +40,7 @@ public RollDiceState(TurnState turnAutomaton, ServerGameLogic logic) { @Override public void enter() { LOGGER.log(System.Logger.Level.DEBUG, "Entered RollDiceState state."); - if (resetModifier){ + if (resetModifier) { logic.getGame().setDiceModifier(1); } this.setCurrentState(this.firstRollState); @@ -65,7 +65,7 @@ public void received(RequestDieMessage msg, int from) { } @Override - public void received(AnimationEndMessage msg, int from){ + public void received(AnimationEndMessage msg, int from) { this.currentState.received(msg, from); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/ChoosePieceAutomatonState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/ChoosePieceAutomatonState.java index bb72325c..3c0c4247 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/ChoosePieceAutomatonState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/ChoosePieceAutomatonState.java @@ -1,7 +1,6 @@ package pp.mdga.server.automaton.game.turn.choosepiece; import pp.mdga.game.*; -import pp.mdga.message.client.AnimationEndMessage; import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.ServerState; import pp.mdga.server.automaton.game.turn.ChoosePieceState; @@ -43,8 +42,7 @@ protected boolean canMove(Piece piece) { if (canPieceMoveInHome(piece, steps)) { return true; } - } - else { + } else { if (canPieceMoveInHome(piece, steps)) { return true; } @@ -55,8 +53,8 @@ else if (40 > targetIdx && (!piece.getState().equals(PieceState.HOME) || !piece. //checks if the target-node is not occupied by an own color if (!tartgetNode.isOccupied(activeColor)) { //checks if the targetNode is not occupied or the occupant ha no shield - if(tartgetNode.isOccupied()) { - if(tartgetNode.getOccupant().getShield().equals(ShieldState.ACTIVE)) { + if (tartgetNode.isOccupied()) { + if (tartgetNode.getOccupant().getShield().equals(ShieldState.ACTIVE)) { System.out.println("Server: targetNode.getOccupant().getShield().equals(ShieldState.ACTIVE" + tartgetNode.getOccupant().getShield().equals(ShieldState.ACTIVE)); return false; } @@ -88,8 +86,7 @@ protected boolean canPieceMoveInHome(Piece piece, int steps) { //tests if the steps are less than the possible movement if ((3 - homeIdx) >= steps - 1) { return !jumpOver(steps, homeIdx, false); - } - else { + } else { return false; } } @@ -107,8 +104,7 @@ else if (piece.getState() == PieceState.ACTIVE) { if (restMovement >= 4) return false; return !jumpOver(restMovement, 0, true); } - } - else { + } else { return false; } return false; @@ -126,7 +122,7 @@ private boolean jumpOver(int stepsInHome, int homeIdx, boolean outside) { //tests if the piece comes from the outside in the home if (outside) { System.out.println("Server: jumpOver: for the homeIndex: " + homeIdx + " ,stepsInHome: " + stepsInHome + " , outside: " + outside + " annd the targetIndex: " + stepsInHome); - if(stepsInHome>3) return true; + if (stepsInHome > 3) return true; if (logic.getGame().getActivePlayer().getHomeNodes()[stepsInHome].isOccupied()) return true; for (int i = 0; i <= stepsInHome; i++) { if (logic.getGame().getActivePlayer().getHomeNodes()[i].isOccupied()) return true; @@ -136,7 +132,7 @@ private boolean jumpOver(int stepsInHome, int homeIdx, boolean outside) { else { int targetIndex = stepsInHome + homeIdx; System.out.println("Server: jumpOver: for the homeIndex: " + homeIdx + " ,stepsInHome: " + stepsInHome + " , outside: " + outside + " and the targetIndex: " + targetIndex); - if(targetIndex>3) return true; + if (targetIndex > 3) return true; if (logic.getGame().getActivePlayer().getHomeNodes()[targetIndex].isOccupied()) return true; for (int i = 1 + homeIdx; i <= targetIndex; i++) { if (logic.getGame().getActivePlayer().getHomeNodes()[i].isOccupied()) return true; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoPieceState.java index 4d80be7a..59fe977f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoPieceState.java @@ -1,8 +1,8 @@ package pp.mdga.server.automaton.game.turn.choosepiece; -import pp.mdga.Resources; -import pp.mdga.game.*; -import pp.mdga.message.client.AnimationEndMessage; +import pp.mdga.game.Piece; +import pp.mdga.game.PieceState; +import pp.mdga.game.Player; import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.game.turn.ChoosePieceState; @@ -36,24 +36,19 @@ private void initialize() { } } this.choosePieceAutomaton.setCurrentState(this.choosePieceAutomaton.getNoTurnState()); - } - else if (activePlayer.hasPieceInWaitingArea()) { + } else if (activePlayer.hasPieceInWaitingArea()) { if (!logic.getGame().getBoard().getInfield()[activePlayer.getStartNodeIndex()].isOccupied(activePlayer.getColor())) { if (logic.getGame().getDiceEyes() == 6) { this.choosePieceAutomaton.setCurrentState(this.choosePieceAutomaton.getWaitingPieceState()); - } - else { + } else { checkSelectPiece(activePlayer); } - } - else if (canMove(logic.getGame().getBoard().getInfield()[activePlayer.getStartNodeIndex()].getOccupant())) { + } else if (canMove(logic.getGame().getBoard().getInfield()[activePlayer.getStartNodeIndex()].getOccupant())) { this.choosePieceAutomaton.setCurrentState(this.choosePieceAutomaton.getStartPieceState()); - } - else { + } else { checkSelectPiece(activePlayer); } - } - else { + } else { checkSelectPiece(activePlayer); } } @@ -68,8 +63,7 @@ private void checkSelectPiece(Player activePlayer) { moveablePieces.removeIf(piece -> !canMove(piece)); if (moveablePieces.isEmpty()) { this.choosePieceAutomaton.setCurrentState(this.choosePieceAutomaton.getNoTurnState()); - } - else { + } else { this.choosePieceAutomaton.getSelectPieceState().setMoveablePieces(moveablePieces); this.choosePieceAutomaton.setCurrentState(this.choosePieceAutomaton.getSelectPieceState()); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/SelectPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/SelectPieceState.java index f3d2af32..867323db 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/SelectPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/SelectPieceState.java @@ -48,8 +48,7 @@ public void enter() { int target = getHomeTargetIdx(piece, steps); targetIndex.add(target); isHomeMove.add(true); - } - else { + } else { int target = getInfieldTarget(piece, steps); targetIndex.add(target); isHomeMove.add(false); @@ -78,15 +77,13 @@ public void received(RequestMoveMessage msg, int from) { Node targetNode = logic.getGame().getActivePlayer().getHomeNodes()[targetHomeIdx]; if (targetHomeIdx == logic.getGame().getActivePlayer().getHighestHomeIdx()) { piece.setState(PieceState.HOMEFINISHED); - } - else { + } else { piece.setState(PieceState.HOME); } oldNode.clearOccupant(); targetNode.setOccupant(piece); - } - else { + } else { int oldNoteIdx = logic.getGame().getBoard().getInfieldIndexOfPiece(piece); Node oldNode = logic.getGame().getBoard().getInfield()[oldNoteIdx]; @@ -96,8 +93,7 @@ public void received(RequestMoveMessage msg, int from) { if (targetHomeIdx == logic.getGame().getActivePlayer().getHighestHomeIdx()) { piece.setState(PieceState.HOMEFINISHED); - } - else { + } else { piece.setState(PieceState.HOME); } @@ -105,8 +101,7 @@ public void received(RequestMoveMessage msg, int from) { targetNode.setOccupant(piece); } LOGGER.log(System.Logger.Level.INFO, "Server : SelectPieceState: PieceState:" + piece.getState()); - } - else { + } else { LOGGER.log(System.Logger.Level.INFO, "Server : SelectPieceState: PieceState:" + piece.getState()); int oldNoteIdx = logic.getGame().getBoard().getInfieldIndexOfPiece(piece); Node oldNode = logic.getGame().getBoard().getInfield()[oldNoteIdx]; @@ -147,8 +142,7 @@ public void received(RequestMoveMessage msg, int from) { PowerCard cardToDraw = logic.getGame().draw(); p.addHandCard(cardToDraw); logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(cardToDraw)); - } - else { + } else { logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard())); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/StartPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/StartPieceState.java index dc3237d0..96bedc62 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/StartPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/StartPieceState.java @@ -75,8 +75,7 @@ public void received(RequestMoveMessage msg, int from) { PowerCard cardToDraw = logic.getGame().draw(); p.addHandCard(cardToDraw); logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(cardToDraw)); - } - else { + } else { logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard())); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/WaitingPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/WaitingPieceState.java index 03ca0f81..9325f9ba 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/WaitingPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/WaitingPieceState.java @@ -2,13 +2,11 @@ import pp.mdga.game.Piece; import pp.mdga.game.PieceState; -import pp.mdga.game.ShieldState; import pp.mdga.message.client.RequestMoveMessage; import pp.mdga.message.server.MoveMessage; import pp.mdga.message.server.WaitPieceMessage; import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.game.turn.ChoosePieceState; -import pp.mdga.server.automaton.game.turn.rolldice.FirstRollState; public class WaitingPieceState extends ChoosePieceAutomatonState { /** @@ -38,7 +36,7 @@ public void enter() { } @Override - public void received(RequestMoveMessage msg, int from){ + public void received(RequestMoveMessage msg, int from) { if (msg.getPiece().equals(this.piece)) { logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).removeWaitingPiece(this.piece); piece.setState(PieceState.ACTIVE); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/ChoosePowerCardState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/ChoosePowerCardState.java index 577ebc2f..9396ca68 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/ChoosePowerCardState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/ChoosePowerCardState.java @@ -1,11 +1,7 @@ package pp.mdga.server.automaton.game.turn.powercard; import pp.mdga.game.BonusCard; -import pp.mdga.game.card.HiddenCard; -import pp.mdga.game.card.PowerCard; -import pp.mdga.game.card.ShieldCard; -import pp.mdga.game.card.SwapCard; -import pp.mdga.game.card.TurboCard; +import pp.mdga.game.card.*; import pp.mdga.message.client.NoPowerCardMessage; import pp.mdga.message.client.SelectCardMessage; import pp.mdga.message.server.DiceNowMessage; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/PowerCardAutomatonState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/PowerCardAutomatonState.java index da8c83a7..b1c3707e 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/PowerCardAutomatonState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/PowerCardAutomatonState.java @@ -14,7 +14,7 @@ public abstract class PowerCardAutomatonState extends ServerState { * Constructs a server state of the specified game logic. * * @param powerCardAutomaton as the automaton of the turn state as a PowerCardState object. - * @param logic the game logic + * @param logic the game logic */ public PowerCardAutomatonState(PowerCardState powerCardAutomaton, ServerGameLogic logic) { super(logic); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/ShieldCardState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/ShieldCardState.java index df983a52..2ec02300 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/ShieldCardState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/ShieldCardState.java @@ -1,9 +1,7 @@ package pp.mdga.server.automaton.game.turn.powercard; import pp.mdga.game.Piece; -import pp.mdga.game.PieceState; import pp.mdga.game.ShieldState; -import pp.mdga.game.card.PowerCard; import pp.mdga.message.client.SelectedPiecesMessage; import pp.mdga.message.server.IncorrectRequestMessage; import pp.mdga.message.server.PlayCardMessage; @@ -62,8 +60,7 @@ public void received(SelectedPiecesMessage msg, int from) { this.logic.getGame().getPlayerByColor(this.logic.getGame().getActiveColor()).removeHandCard(this.powerCardAutomaton.getSelectedCard()); this.logic.getGame().getDiscardPile().add(this.powerCardAutomaton.getSelectedCard()); this.powerCardAutomaton.getTurnAutomaton().setCurrentState(this.powerCardAutomaton.getTurnAutomaton().getPlayPowerCardState()); - } - else { + } else { this.logic.getServerSender().send(from, new IncorrectRequestMessage(3)); } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/SwapCardState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/SwapCardState.java index aa8e09cf..ce361b9e 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/SwapCardState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/powercard/SwapCardState.java @@ -1,7 +1,6 @@ package pp.mdga.server.automaton.game.turn.powercard; import pp.mdga.game.Board; -import pp.mdga.game.Color; import pp.mdga.game.Node; import pp.mdga.game.Piece; import pp.mdga.game.card.SwapCard; @@ -12,7 +11,6 @@ import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.game.turn.PowerCardState; -import java.util.ArrayList; import java.util.List; public class SwapCardState extends PowerCardAutomatonState { @@ -58,12 +56,12 @@ public void received(SelectedPiecesMessage msg, int from) { if (msg.getPieces().size() == 2) { Piece selOwn = msg.getPieces().get(0); Piece selEnemy = msg.getPieces().get(1); - System.out.println("Server: Swapcard: ownPiece: "+selOwn+ " enemyPiece: "+selEnemy); + System.out.println("Server: Swapcard: ownPiece: " + selOwn + " enemyPiece: " + selEnemy); List ownPieces = this.powerCardAutomaton.getVisitor().getSwapOwnPieces(); List enemyPieces = this.powerCardAutomaton.getVisitor().getSwapOtherPieces(); //if selOwn and selEnemy is in wrong order - if(ownPieces.contains(selEnemy) && enemyPieces.contains(selOwn)){ + if (ownPieces.contains(selEnemy) && enemyPieces.contains(selOwn)) { Piece temp = selEnemy; selEnemy = selOwn; selOwn = temp; @@ -73,7 +71,8 @@ public void received(SelectedPiecesMessage msg, int from) { this.powerCardAutomaton.addSelectedPiece(selOwn); this.powerCardAutomaton.addSelectedPiece(selEnemy); - if(!(powerCardAutomaton.getSelectedCard() instanceof SwapCard)) throw new RuntimeException("getSelectedCard is not swapCard"); + if (!(powerCardAutomaton.getSelectedCard() instanceof SwapCard)) + throw new RuntimeException("getSelectedCard is not swapCard"); swapPieces(selOwn, selEnemy); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/FirstRollState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/FirstRollState.java index 0fe24c59..c7ee4a36 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/FirstRollState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/FirstRollState.java @@ -6,8 +6,6 @@ import pp.mdga.message.client.AnimationEndMessage; import pp.mdga.message.client.RequestDieMessage; import pp.mdga.message.server.ChoosePieceStateMessage; -import pp.mdga.message.server.DiceAgainMessage; -import pp.mdga.message.server.DiceNowMessage; import pp.mdga.message.server.DieMessage; import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.game.turn.RollDiceState; @@ -75,7 +73,7 @@ public void received(RequestDieMessage msg, int from) { public void received(AnimationEndMessage msg, int from) { if (from != this.logic.getGame().getActivePlayerId()) { LOGGER.log(System.Logger.Level.INFO, "Received AnimationEndMessage from wrong player."); - } else if (!isDied){ + } else if (!isDied) { LOGGER.log(System.Logger.Level.INFO, "Received AnimationEndMessage without the active player rolling a die."); } else if (!moveablePieces.isEmpty()) { this.logic.getServerSender().send(this.logic.getGame().getActivePlayerId(), new ChoosePieceStateMessage()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/SecondRollState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/SecondRollState.java index 09d2ce01..d2625fad 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/SecondRollState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/SecondRollState.java @@ -4,7 +4,6 @@ import pp.mdga.message.client.AnimationEndMessage; import pp.mdga.message.client.RequestDieMessage; import pp.mdga.message.server.ChoosePieceStateMessage; -import pp.mdga.message.server.DiceAgainMessage; import pp.mdga.message.server.DiceNowMessage; import pp.mdga.message.server.DieMessage; import pp.mdga.server.ServerGameLogic; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/visitor/ServerCardVisitor.java b/Projekte/mdga/model/src/main/java/pp/mdga/visitor/ServerCardVisitor.java index b4964fef..f83490b5 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/visitor/ServerCardVisitor.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/visitor/ServerCardVisitor.java @@ -2,11 +2,7 @@ import pp.mdga.game.Piece; import pp.mdga.game.PieceState; -import pp.mdga.game.card.HiddenCard; -import pp.mdga.game.card.PowerCard; -import pp.mdga.game.card.ShieldCard; -import pp.mdga.game.card.SwapCard; -import pp.mdga.game.card.TurboCard; +import pp.mdga.game.card.*; import pp.mdga.server.ServerGameLogic; import java.util.ArrayList; diff --git a/Projekte/mdga/model/src/test/java/pp/mdga/client/clientState/ClientStateTest.java b/Projekte/mdga/model/src/test/java/pp/mdga/client/clientState/ClientStateTest.java index fe4b82bf..74f9c204 100644 --- a/Projekte/mdga/model/src/test/java/pp/mdga/client/clientState/ClientStateTest.java +++ b/Projekte/mdga/model/src/test/java/pp/mdga/client/clientState/ClientStateTest.java @@ -1,29 +1,28 @@ package pp.mdga.client.clientState; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; import pp.mdga.client.*; -import pp.mdga.client.ceremonystate.*; -import pp.mdga.client.dialogstate.*; -import pp.mdga.client.gamestate.AnimationState; -import pp.mdga.client.gamestate.DetermineStartPlayerState; -import pp.mdga.client.gamestate.SpectatorState; -import pp.mdga.client.gamestate.TurnState; -import pp.mdga.client.gamestate.WaitingState; +import pp.mdga.client.ceremonystate.PodiumState; +import pp.mdga.client.ceremonystate.StatisticsState; +import pp.mdga.client.dialogstate.LobbyState; +import pp.mdga.client.dialogstate.NetworkDialogState; +import pp.mdga.client.dialogstate.StartDialogState; +import pp.mdga.client.gamestate.*; import pp.mdga.client.gamestate.determinestartplayerstate.RollRankingDiceState; import pp.mdga.client.gamestate.determinestartplayerstate.WaitRankingState; -import pp.mdga.client.gamestate.turnstate.ChoosePieceState; -import pp.mdga.client.gamestate.turnstate.MovePieceState; import pp.mdga.client.gamestate.turnstate.*; -import pp.mdga.client.gamestate.turnstate.choosepiecestate.*; -import pp.mdga.client.gamestate.turnstate.powercardstate.*; -import pp.mdga.game.Game; -import pp.mdga.game.Piece; -import pp.mdga.game.PieceState; -import pp.mdga.game.Player; +import pp.mdga.client.gamestate.turnstate.choosepiecestate.NoPieceState; +import pp.mdga.client.gamestate.turnstate.choosepiecestate.SelectPieceState; +import pp.mdga.client.gamestate.turnstate.choosepiecestate.StartPieceState; +import pp.mdga.client.gamestate.turnstate.choosepiecestate.WaitingPieceState; +import pp.mdga.client.gamestate.turnstate.powercardstate.ChoosePowerCardState; +import pp.mdga.client.gamestate.turnstate.powercardstate.ShieldState; +import pp.mdga.client.gamestate.turnstate.powercardstate.SwapState; +import pp.mdga.game.*; import pp.mdga.game.card.PowerCard; -import pp.mdga.message.server.*; -import pp.mdga.game.Color; import pp.mdga.message.client.ClientMessage; +import pp.mdga.message.server.*; import pp.mdga.visitor.Visitor; import java.util.ArrayList; @@ -128,7 +127,7 @@ public class ClientStateTest { private Piece ownPiece; //declare enemy piece - private Piece enemyPiece ; + private Piece enemyPiece; @Before public void setUp() { @@ -152,13 +151,13 @@ public void send(ClientMessage msg) { player = new Player(name); player.setColor(color); player.initialize(); - game.addPlayer(1234,player); + game.addPlayer(1234, player); game.setActiveColor(color); ownPiece = player.getWaitingPiece(); ownPiece.setState(PieceState.ACTIVE); player.removeWaitingPiece(ownPiece); - game.getBoard().setPieceOnBoard(22,ownPiece); + game.getBoard().setPieceOnBoard(22, ownPiece); //todo piece @@ -174,7 +173,7 @@ public void accept(Visitor visitor) { } }; - turboCard = new PowerCard() { + turboCard = new PowerCard() { @Override public void accept(Visitor visitor) { @@ -184,23 +183,23 @@ public void accept(Visitor visitor) { //declare ownPlayer //declare other player - enemy= new Player(name); + enemy = new Player(name); enemy.setColor(Color.CYBER); - enemyColor=Color.CYBER; - game.addPlayer(2345,enemy); + enemyColor = Color.CYBER; + game.addPlayer(2345, enemy); enemy.initialize(); enemyPiece = enemy.getWaitingPiece(); enemyPiece.setState(PieceState.ACTIVE); enemy.removeWaitingPiece(enemyPiece); - game.getBoard().setPieceOnBoard(33,enemyPiece); + game.getBoard().setPieceOnBoard(33, enemyPiece); //sets the player in the game - clientGameLogic.getGame().addPlayer(0,player); - clientGameLogic.getGame().addPlayer(1,enemy); - clientGameLogic.getGame().getBoard().setPieceOnBoard(15,ownPiece); - clientGameLogic.getGame().getBoard().setPieceOnBoard(25,enemyPiece); + clientGameLogic.getGame().addPlayer(0, player); + clientGameLogic.getGame().addPlayer(1, enemy); + clientGameLogic.getGame().getBoard().setPieceOnBoard(15, ownPiece); + clientGameLogic.getGame().getBoard().setPieceOnBoard(25, enemyPiece); //initialize the messages from the server @@ -215,15 +214,15 @@ public void accept(Visitor visitor) { endOfTurn = new EndOfTurnMessage(); lobbyAccept = new LobbyAcceptMessage(); lobbyDeny = new LobbyDenyMessage(); - lobbyPlayerJoin = new LobbyPlayerJoinedMessage(from, player,true); + lobbyPlayerJoin = new LobbyPlayerJoinedMessage(from, player, true); lobbyPlayerLeave = new LobbyPlayerLeaveMessage(from); moveMessage = new MoveMessage(ownPiece, false, 25); noTurn = new NoTurnMessage(); interruptMessage = new PauseGameMessage(); playCardSwap = new PlayCardMessage(swapCard, new ArrayList<>(List.of(ownPiece, enemyPiece)), 1); //TODO playCardShield = new PlayCardMessage(shieldCard, new ArrayList<>(List.of(ownPiece)), 1); - playCardTurbo = new PlayCardMessage(turboCard, new ArrayList<>(List.of(ownPiece)),1); - possibleCard = new PossibleCardsMessage(new ArrayList<>(List.of(swapCard,shieldCard,turboCard))); + playCardTurbo = new PlayCardMessage(turboCard, new ArrayList<>(List.of(ownPiece)), 1); + possibleCard = new PossibleCardsMessage(new ArrayList<>(List.of(swapCard, shieldCard, turboCard))); possiblePieceShield = PossiblePieceMessage.shieldPossiblePieces(new ArrayList<>(List.of(ownPiece))); //TODO possiblePieceSwap = PossiblePieceMessage.swapPossiblePieces(new ArrayList<>(List.of(ownPiece)), new ArrayList<>(List.of(enemyPiece))); //TODO //todo possiblePieceSwap = new PossiblePieceMessage(new ArrayList<>(List.of(ownPiece)), new ArrayList<>(List.of(enemyPiece))); @@ -233,13 +232,13 @@ public void accept(Visitor visitor) { reconnectBriefing = new ReconnectBriefingMessage(game); resumeGame = new ResumeGameMessage(); startGame = new ServerStartGameMessage(); - startPieceMessage = new StartPieceMessage(ownPiece.getUuid(),25); + startPieceMessage = new StartPieceMessage(ownPiece.getUuid(), 25); updateReady = new UpdateReadyMessage(2345, true); - updateTSK = new UpdateTSKMessage(2345, Color.NAVY,false); + updateTSK = new UpdateTSKMessage(2345, Color.NAVY, false); waitPiece = new WaitPieceMessage(ownPiece.getUuid()); interruptMessage = new PauseGameMessage(); spectatorMessage = new SpectatorMessage(); - selectPieceMessage = new SelectPieceMessage(new ArrayList<>(List.of(ownPiece)),new ArrayList<>(List.of(false)), new ArrayList<>(List.of(25))); + selectPieceMessage = new SelectPieceMessage(new ArrayList<>(List.of(ownPiece)), new ArrayList<>(List.of(false)), new ArrayList<>(List.of(25))); //initialize the client-state //sets the clientGameLogic-states @@ -719,7 +718,7 @@ public void testNetworkDialogToLobby() { //simulate connect to server with send lobby request clientGameLogic.selectJoin("IP"); - clientGameLogic.received(new LobbyAcceptMessage(1234) ); + clientGameLogic.received(new LobbyAcceptMessage(1234)); assertEquals(clientGameLogic.getState(), dialogs); assertEquals(dialogs.getState(), lobby); @@ -859,7 +858,7 @@ public void testDetermineStartPlayerToWait() { //tests if the client is in the intro assertEquals(clientGameLogic.getState(), gameState); assertEquals(gameState.getState(), determineStartPlayer); - assertEquals(determineStartPlayer.getState(),determineStartPlayer.getIntro()); + assertEquals(determineStartPlayer.getState(), determineStartPlayer.getIntro()); //todo diff --git a/Projekte/mdga/model/src/test/java/pp/mdga/game/PieceTest.java b/Projekte/mdga/model/src/test/java/pp/mdga/game/PieceTest.java index b87eada4..741c3c65 100644 --- a/Projekte/mdga/model/src/test/java/pp/mdga/game/PieceTest.java +++ b/Projekte/mdga/model/src/test/java/pp/mdga/game/PieceTest.java @@ -3,11 +3,7 @@ import org.junit.Before; import org.junit.Test; import pp.mdga.game.card.PowerCard; -import pp.mdga.message.client.AnimationEndMessage; -import pp.mdga.message.client.RequestDieMessage; -import pp.mdga.message.client.RequestMoveMessage; -import pp.mdga.message.client.RequestPlayCardMessage; -import pp.mdga.message.client.SelectCardMessage; +import pp.mdga.message.client.*; import pp.mdga.message.server.ServerMessage; import pp.mdga.server.ServerGameLogic; import pp.mdga.server.ServerSender; @@ -172,7 +168,7 @@ public void shutdown() { game.addPlayer(IDCyber, playerCyber); //initialize the playerData - for(Map.Entry entry : game.getPlayers().entrySet()){ + for (Map.Entry entry : game.getPlayers().entrySet()) { game.addPlayer(entry.getKey(), entry.getValue()); } @@ -225,26 +221,26 @@ public void shutdown() { //set the pieces of cyber - game.getBoard().setPieceOnBoard(10,pieceCyber0); // for UC 6,7,8 - game.getBoard().setPieceOnBoard(12,pieceCyber1); // + game.getBoard().setPieceOnBoard(10, pieceCyber0); // for UC 6,7,8 + game.getBoard().setPieceOnBoard(12, pieceCyber1); // game.getPlayerByColor(cyberColor).addWaitingPiece(pieceClient3); //for uc 7 //game..... todo //initializes the states - gameState= serverGameLogic.getGameState(); - turnState= gameState.getTurnState(); - rollDiceState= turnState.getRollDiceState(); - firstRollState= rollDiceState.getFirstRollState(); - choosePieceState= turnState.getChoosePieceState(); - selectPieceState= choosePieceState.getSelectPieceState(); + gameState = serverGameLogic.getGameState(); + turnState = gameState.getTurnState(); + rollDiceState = turnState.getRollDiceState(); + firstRollState = rollDiceState.getFirstRollState(); + choosePieceState = turnState.getChoosePieceState(); + selectPieceState = choosePieceState.getSelectPieceState(); powerCardState = turnState.getPowerCardState(); playPowerCardState = turnState.getPlayPowerCardState(); - waitingPieceState =serverGameLogic.getGameState().getTurnState().getChoosePieceState().getWaitingPieceState(); + waitingPieceState = serverGameLogic.getGameState().getTurnState().getChoosePieceState().getWaitingPieceState(); startPieceState = serverGameLogic.getGameState().getTurnState().getChoosePieceState().getStartPieceState(); //initialize dies die1 = new Die(1); - die2= new Die(2); + die2 = new Die(2); die3 = new Die(3); die4 = new Die(4); die5 = new Die(5); @@ -267,10 +263,10 @@ public void testMove() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //sets the active Player to host game.setActiveColor(hostColor); @@ -280,31 +276,31 @@ public void testMove() { game.setDie(die4); //sends the request-die-message - serverGameLogic.received(new RequestDieMessage(),IDHost); + serverGameLogic.received(new RequestDieMessage(), IDHost); //tests if the server is in selectPieceState assertTrue(game.getBoard().getInfield()[12].isOccupied()); - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),choosePieceState); - assertEquals(choosePieceState.getCurrentState(),selectPieceState); + assertEquals(turnState.getCurrentState(), choosePieceState); + assertEquals(choosePieceState.getCurrentState(), selectPieceState); //send wrong message - serverGameLogic.received(new RequestMoveMessage(pieceCyber1),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceCyber1), IDHost); //tests if there is no change assertTrue(game.getBoard().getInfield()[12].isOccupied()); - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),choosePieceState); - assertEquals(choosePieceState.getCurrentState(),selectPieceState); + assertEquals(turnState.getCurrentState(), choosePieceState); + assertEquals(choosePieceState.getCurrentState(), selectPieceState); //sends the move-message - serverGameLogic.received(new RequestMoveMessage(pieceHost2),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost2), IDHost); //tests if the piece has moved in the right direction assertTrue(game.getBoard().getInfield()[4].isOccupied()); - assertEquals(game.getBoard().getInfield()[4].getOccupant(),pieceHost3); + assertEquals(game.getBoard().getInfield()[4].getOccupant(), pieceHost3); } /** @@ -322,10 +318,10 @@ public void testCantMove() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //set active player to army game.setActiveColor(clientColor); @@ -334,18 +330,18 @@ public void testCantMove() { game.setDie(die2); //send request Die-message - serverGameLogic.received(new RequestDieMessage(),IDClient); + serverGameLogic.received(new RequestDieMessage(), IDClient); //send requestMove-Message - serverGameLogic.received(new RequestMoveMessage(pieceClient2),IDClient); + serverGameLogic.received(new RequestMoveMessage(pieceClient2), IDClient); //tests if the hostPiece2 is still at idx 19 and the server is still in selectable pieces assertTrue(game.getBoard().getInfield()[19].isOccupied()); - assertEquals(game.getBoard().getInfield()[19].getOccupant(),pieceClient2); - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(game.getBoard().getInfield()[19].getOccupant(), pieceClient2); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),choosePieceState); - assertEquals(choosePieceState.getCurrentState(),selectPieceState); + assertEquals(turnState.getCurrentState(), choosePieceState); + assertEquals(choosePieceState.getCurrentState(), selectPieceState); } /** @@ -374,10 +370,10 @@ public void testThrow() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //set active player to host game.setActiveColor(hostColor); @@ -386,10 +382,10 @@ public void testThrow() { game.setDie(die1); //send requestDice - serverGameLogic.received(new RequestDieMessage(),IDHost); + serverGameLogic.received(new RequestDieMessage(), IDHost); //send requestMove-message - serverGameLogic.received(new RequestMoveMessage(pieceHost1),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost1), IDHost); //tests if the idx is unoccupied assertFalse(game.getBoard().getInfield()[19].isOccupied()); @@ -398,7 +394,7 @@ public void testThrow() { assertTrue(game.getBoard().getInfield()[20].isOccupied()); //tests if the piece on idx 20 is pieceHost1 - assertEquals(game.getBoard().getInfield()[20].getOccupant(),pieceHost1); + assertEquals(game.getBoard().getInfield()[20].getOccupant(), pieceHost1); } /** @@ -419,23 +415,23 @@ public void testGetThrown() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //set Dice to 1 game.setDie(die1); //send requestDice - serverGameLogic.received(new RequestDieMessage(),IDHost); + serverGameLogic.received(new RequestDieMessage(), IDHost); //send requestMove-message - serverGameLogic.received(new RequestMoveMessage(pieceHost1),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost1), IDHost); //tests if pieceClient2 is waitingArea Piece[] wait = game.getPlayerByColor(clientColor).getWaitingArea(); - assertTrue(wait[0]==pieceClient2 ||wait[1]==pieceClient2 ||wait[2]==pieceClient2 ||wait[3]==pieceClient2 ); + assertTrue(wait[0] == pieceClient2 || wait[1] == pieceClient2 || wait[2] == pieceClient2 || wait[3] == pieceClient2); } /** @@ -453,10 +449,10 @@ public void testLeaveWaitingArea() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //set active player to host game.setActiveColor(hostColor); @@ -465,23 +461,23 @@ public void testLeaveWaitingArea() { game.setDie(die6); //send requestDice - serverGameLogic.received(new RequestDieMessage(),IDHost); + serverGameLogic.received(new RequestDieMessage(), IDHost); //tests if the sever is in selectPiece - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),choosePieceState); - assertEquals(choosePieceState.getCurrentState(),waitingPieceState); + assertEquals(turnState.getCurrentState(), choosePieceState); + assertEquals(choosePieceState.getCurrentState(), waitingPieceState); //send requestMove-message - serverGameLogic.received(new RequestMoveMessage(pieceHost2),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost2), IDHost); //tests if the waitingArea does not include the piece anymore assertFalse(Arrays.stream(game.getPlayerByColor(hostColor).getWaitingArea()).toList().contains(pieceHost2)); //tests if the pieceHost3 is at idx 30 assertTrue(game.getBoard().getInfield()[30].isOccupied()); - assertEquals(game.getBoard().getInfield()[30].getOccupant(),pieceHost2); + assertEquals(game.getBoard().getInfield()[30].getOccupant(), pieceHost2); } /** @@ -499,10 +495,10 @@ public void testMustLeaveStartingField() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //sets the activePlayer to cyber game.setActiveColor(cyberColor); @@ -511,7 +507,7 @@ public void testMustLeaveStartingField() { game.setDie(die4); //send requestDiceMessage - serverGameLogic.received(new RequestDieMessage(),IDCyber); + serverGameLogic.received(new RequestDieMessage(), IDCyber); //tests if the sever is in startPiece serverGameLogic.setCurrentState(gameState); @@ -520,11 +516,11 @@ public void testMustLeaveStartingField() { choosePieceState.setCurrentState(startPieceState); //send requestMoveMessage - serverGameLogic.received(new RequestMoveMessage(pieceHost1),IDCyber); + serverGameLogic.received(new RequestMoveMessage(pieceHost1), IDCyber); //tests if the cyberPiece2 has moved assertTrue(game.getBoard().getInfield()[12].isOccupied()); - assertEquals(game.getBoard().getInfield()[12].getOccupant(),pieceCyber1); + assertEquals(game.getBoard().getInfield()[12].getOccupant(), pieceCyber1); //tests if the sever is in startPiece serverGameLogic.setCurrentState(gameState); @@ -533,11 +529,11 @@ public void testMustLeaveStartingField() { choosePieceState.setCurrentState(startPieceState); //send requestMoveMessage - serverGameLogic.received(new RequestMoveMessage(pieceHost0),IDCyber); + serverGameLogic.received(new RequestMoveMessage(pieceHost0), IDCyber); //tests if the piece is moved assertTrue(game.getBoard().getInfield()[14].isOccupied()); - assertEquals(game.getBoard().getInfield()[14].getOccupant(),pieceHost0); + assertEquals(game.getBoard().getInfield()[14].getOccupant(), pieceHost0); assertFalse(game.getBoard().getInfield()[10].isOccupied()); } @@ -556,10 +552,10 @@ public void testDontHaveToLeaveStartingField() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //set the active player to cyberPlayer game.setActiveColor(cyberColor); @@ -571,16 +567,16 @@ public void testDontHaveToLeaveStartingField() { game.setDie(die3); //tests if the server is in selectPieceState - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),choosePieceState); - assertEquals(choosePieceState.getCurrentState(),selectPieceState); + assertEquals(turnState.getCurrentState(), choosePieceState); + assertEquals(choosePieceState.getCurrentState(), selectPieceState); //send requestDice-Message - serverGameLogic.received(new RequestDieMessage(),IDCyber); + serverGameLogic.received(new RequestDieMessage(), IDCyber); //send requestMoveMessage for CyberPiece1 - serverGameLogic.received(new RequestMoveMessage(pieceCyber1),IDCyber); + serverGameLogic.received(new RequestMoveMessage(pieceCyber1), IDCyber); //tests if the cyberPiece1 is moved assertTrue(game.getBoard().getInfield()[15].isOccupied()); @@ -603,10 +599,10 @@ public void testCantLeaveStartingField() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //sets the activePlayer to cyber game.setActiveColor(cyberColor); @@ -615,36 +611,36 @@ public void testCantLeaveStartingField() { game.setDie(die2); //send requestDiceMessage - serverGameLogic.received(new RequestDieMessage(),IDCyber); + serverGameLogic.received(new RequestDieMessage(), IDCyber); //tests if the sever is in selectPiece - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),choosePieceState); - assertEquals(choosePieceState.getCurrentState(),selectPieceState); + assertEquals(turnState.getCurrentState(), choosePieceState); + assertEquals(choosePieceState.getCurrentState(), selectPieceState); //send requestMoveMessage - serverGameLogic.received(new RequestMoveMessage(pieceCyber0),IDCyber); + serverGameLogic.received(new RequestMoveMessage(pieceCyber0), IDCyber); //tests if the sever is in selectPiece - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),choosePieceState); - assertEquals(choosePieceState.getCurrentState(),selectPieceState); + assertEquals(turnState.getCurrentState(), choosePieceState); + assertEquals(choosePieceState.getCurrentState(), selectPieceState); //tests if the cyberPiece0 is still at its idx assertTrue(game.getBoard().getInfield()[10].isOccupied()); - assertEquals(game.getBoard().getInfield()[10].getOccupant(),pieceHost0); + assertEquals(game.getBoard().getInfield()[10].getOccupant(), pieceHost0); //sets the dice to 2 game.setDie(die2); //send the requestMove-Message - serverGameLogic.received(new RequestMoveMessage(pieceCyber1),IDCyber); + serverGameLogic.received(new RequestMoveMessage(pieceCyber1), IDCyber); //tests if the pieceCyber assertTrue(game.getBoard().getInfield()[14].isOccupied()); - assertEquals(game.getBoard().getInfield()[14].getOccupant(),pieceHost1); + assertEquals(game.getBoard().getInfield()[14].getOccupant(), pieceHost1); } /** @@ -662,10 +658,10 @@ public void testReachBonusField() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //gets the top bonusCard PowerCard card = game.getDrawPile().get(0); @@ -677,14 +673,14 @@ public void testReachBonusField() { game.setDie(die4); //sends the requestDice-Message - serverGameLogic.received(new RequestDieMessage(),IDHost); + serverGameLogic.received(new RequestDieMessage(), IDHost); //requestMove of hostPiece3 - serverGameLogic.received(new RequestMoveMessage(pieceHost3),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost3), IDHost); //tests the position of hostPiece3 assertTrue(game.getBoard().getInfield()[4].isOccupied()); - assertEquals(game.getBoard().getInfield()[4].getOccupant(),pieceHost3); + assertEquals(game.getBoard().getInfield()[4].getOccupant(), pieceHost3); //tests if the player has received a bonusCard assertNotEquals(card, game.getDrawPile().get(0)); @@ -706,10 +702,10 @@ public void testNoPowerCards() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //sets the active Player to Host game.setActiveColor(hostColor); @@ -726,13 +722,13 @@ public void testNoPowerCards() { assertTrue(game.getDiscardPile().isEmpty()); //sends the requestDice-Message - serverGameLogic.received(new RequestMoveMessage(pieceHost1),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost1), IDHost); // requestMOve of hostPiece3 - serverGameLogic.received(new RequestMoveMessage(pieceHost3),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost3), IDHost); assertTrue(game.getBoard().getInfield()[4].isOccupied()); - assertEquals(game.getBoard().getInfield()[4].getOccupant(),pieceHost3); + assertEquals(game.getBoard().getInfield()[4].getOccupant(), pieceHost3); //tests if the player has received a bonusCard assertTrue(game.getDrawPile().isEmpty()); @@ -754,10 +750,10 @@ public void testShufflePile() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //sets the active Player to Host game.setActiveColor(hostColor); @@ -774,13 +770,13 @@ public void testShufflePile() { assertTrue(game.getDrawPile().isEmpty()); //sends the requestDice-Message - serverGameLogic.received(new RequestMoveMessage(pieceHost1),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost1), IDHost); // requestMOve of hostPiece3 - serverGameLogic.received(new RequestMoveMessage(pieceHost3),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost3), IDHost); assertTrue(game.getBoard().getInfield()[4].isOccupied()); - assertEquals(game.getBoard().getInfield()[4].getOccupant(),pieceHost3); + assertEquals(game.getBoard().getInfield()[4].getOccupant(), pieceHost3); //tests if the player has received a bonusCard assertFalse(game.getDrawPile().isEmpty()); @@ -810,20 +806,20 @@ public void testEnterHouse() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //set the die in Game to 1 game.setDie(die1); //sends the request-Dice-message - serverGameLogic.received(new RequestDieMessage(),IDClient); + serverGameLogic.received(new RequestDieMessage(), IDClient); //sends the requestMove-message for pieceClient1 System.out.println(game.getBoard().getInfieldIndexOfPiece(pieceClient2)); - serverGameLogic.received(new RequestMoveMessage(pieceClient2),IDClient); + serverGameLogic.received(new RequestMoveMessage(pieceClient2), IDClient); System.out.println(game.getBoard().getInfieldIndexOfPiece(pieceClient2)); //tests, if the piece is in the first slot of the home @@ -850,24 +846,24 @@ public void testOnlyEnterOwnHouse() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //set the die in Game to 3 game.setDie(die3); //sends the request-Dice-message - serverGameLogic.received(new RequestDieMessage(),IDHost); + serverGameLogic.received(new RequestDieMessage(), IDHost); //sends the requestMove-message for pieceClient1 System.out.println(game.getBoard().getInfieldIndexOfPiece(pieceHost1)); - serverGameLogic.received(new RequestMoveMessage(pieceHost1),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost1), IDHost); //tests if hostPiece1 is at idx 20 TODO false positive assertTrue(game.getBoard().getInfield()[19].isOccupied()); - assertEquals(game.getBoard().getInfield()[20].getOccupant(),pieceHost1); + assertEquals(game.getBoard().getInfield()[20].getOccupant(), pieceHost1); } /** @@ -888,19 +884,19 @@ public void testActiveHomePiece() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //set the die in Game to 2 game.setDie(die2); //sends the request-Dice-message - serverGameLogic.received(new RequestDieMessage(),IDClient); + serverGameLogic.received(new RequestDieMessage(), IDClient); //sends the requestMove-message for pieceClient1 - serverGameLogic.received(new RequestMoveMessage(pieceHost1),IDClient); + serverGameLogic.received(new RequestMoveMessage(pieceHost1), IDClient); //tests if clientPiece1 is in the home at idx 3 assertTrue(game.getPlayerByColor(clientColor).getHomeNodes()[3].isOccupied()); @@ -922,10 +918,10 @@ public void testCantJumpOverFigureInHouse() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //set activePlayer to client game.setActiveColor(clientColor); @@ -934,14 +930,14 @@ public void testCantJumpOverFigureInHouse() { game.setDie(die4); //send requestDice-Message - serverGameLogic.received(new RequestDieMessage(),IDClient); + serverGameLogic.received(new RequestDieMessage(), IDClient); //sends requestMoveMessage with clientPiece 02 - serverGameLogic.received(new RequestMoveMessage(pieceHost2),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost2), IDHost); //tests, if the clientPiece02 is at idx 19 assertTrue(game.getBoard().getInfield()[19].isOccupied()); - assertEquals(game.getBoard().getInfield()[20].getOccupant(),pieceClient2); + assertEquals(game.getBoard().getInfield()[20].getOccupant(), pieceClient2); } /** @@ -959,10 +955,10 @@ public void testActiveHomePieceBlocked() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //set active player to client game.setActiveColor(clientColor); @@ -971,10 +967,10 @@ public void testActiveHomePieceBlocked() { game.setDie(die3); //sends the requestDice-message - serverGameLogic.received(new RequestDieMessage(),IDClient); + serverGameLogic.received(new RequestDieMessage(), IDClient); //sends the request MoveMessage - serverGameLogic.received(new RequestMoveMessage(pieceClient1),IDClient); + serverGameLogic.received(new RequestMoveMessage(pieceClient1), IDClient); //tests if the piece is still at idx 2 in home assertTrue(game.getPlayerByColor(clientColor).getHomeNodes()[1].isOccupied()); @@ -1005,22 +1001,22 @@ public void testOnStartingFieldWithShield() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //sends the requestDice-message - serverGameLogic.received(new RequestDieMessage(),IDHost); + serverGameLogic.received(new RequestDieMessage(), IDHost); //sends the moveMessage - serverGameLogic.received(new RequestMoveMessage(pieceHost1),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost1), IDHost); //tests the position of the hostPiece1 and that shield is suppressed assertTrue(game.getBoard().getInfield()[20].isOccupied()); - assertEquals(game.getBoard().getInfield()[20].getOccupant(),pieceClient1); + assertEquals(game.getBoard().getInfield()[20].getOccupant(), pieceClient1); - assertEquals(pieceHost1.getShield(),ShieldState.SUPPRESSED); + assertEquals(pieceHost1.getShield(), ShieldState.SUPPRESSED); } /** @@ -1047,25 +1043,25 @@ public void testThrowFigureWithShield() { rollDiceState.setCurrentState(firstRollState); //tests if the server is in firstRoll - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),rollDiceState); - assertEquals(rollDiceState.getCurrentState(),firstRollState); + assertEquals(turnState.getCurrentState(), rollDiceState); + assertEquals(rollDiceState.getCurrentState(), firstRollState); //send requestDice - serverGameLogic.received(new RequestDieMessage(),IDHost); + serverGameLogic.received(new RequestDieMessage(), IDHost); //send requestMove of hostPiece1 - serverGameLogic.received(new RequestMoveMessage(pieceHost1),IDHost); + serverGameLogic.received(new RequestMoveMessage(pieceHost1), IDHost); //tests if the clientPiece2 is still at idx 19 and hostPiece1 at idx 18 and clientPiece2 shield is still active assertTrue(game.getBoard().getInfield()[19].isOccupied()); assertTrue(game.getBoard().getInfield()[18].isOccupied()); - assertEquals(game.getBoard().getInfield()[18].getOccupant(),pieceHost1); - assertEquals(game.getBoard().getInfield()[19].getOccupant(),pieceClient2); + assertEquals(game.getBoard().getInfield()[18].getOccupant(), pieceHost1); + assertEquals(game.getBoard().getInfield()[19].getOccupant(), pieceClient2); - assertEquals(pieceClient2.getShield(),ShieldState.ACTIVE); + assertEquals(pieceClient2.getShield(), ShieldState.ACTIVE); } /** @@ -1082,31 +1078,31 @@ public void testUseSwap() { serverGameLogic.getGameState().getTurnState().setCurrentState(powerCardState); //tests if the server is in selectPieces - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),powerCardState); + assertEquals(turnState.getCurrentState(), powerCardState); //set activePlayer to Host game.setActiveColor(hostColor); //sends the requestPlayCard - serverGameLogic.received(new SelectCardMessage(swapCard),IDHost); + serverGameLogic.received(new SelectCardMessage(swapCard), IDHost); //sends the selectedPiece-message - serverGameLogic.received(RequestPlayCardMessage.requestPlaySwap(pieceHost0.getUuid(),pieceClient0.getUuid()),IDHost); + serverGameLogic.received(RequestPlayCardMessage.requestPlaySwap(pieceHost0.getUuid(), pieceClient0.getUuid()), IDHost); //tests if the piece at idx 25 is pieceHost0 and at idx 28 is pieceClient0 assertTrue(game.getBoard().getInfield()[25].isOccupied()); - assertEquals(game.getBoard().getInfield()[25].getOccupant(),pieceHost0); + assertEquals(game.getBoard().getInfield()[25].getOccupant(), pieceHost0); assertTrue(game.getBoard().getInfield()[28].isOccupied()); - assertEquals(game.getBoard().getInfield()[28].getOccupant(),pieceClient0); + assertEquals(game.getBoard().getInfield()[28].getOccupant(), pieceClient0); //tests if the server is in playPowerCard - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),playPowerCardState); + assertEquals(turnState.getCurrentState(), playPowerCardState); } /** @@ -1123,26 +1119,26 @@ public void testUseShield() { serverGameLogic.getGameState().getTurnState().setCurrentState(powerCardState); //tests if the server is in selectPieces - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),powerCardState); + assertEquals(turnState.getCurrentState(), powerCardState); //set activePlayer to Host game.setActiveColor(hostColor); //sends the requestPlayCard - serverGameLogic.received(new SelectCardMessage(shieldCard),IDHost); + serverGameLogic.received(new SelectCardMessage(shieldCard), IDHost); //sends the selectedPiece-message - serverGameLogic.received(RequestPlayCardMessage.requestPlayShield(pieceHost0.getUuid()),IDHost); + serverGameLogic.received(RequestPlayCardMessage.requestPlayShield(pieceHost0.getUuid()), IDHost); //tests if the piece at idx 28 has a shield - assertEquals(pieceHost0.getShield(),ShieldState.ACTIVE); + assertEquals(pieceHost0.getShield(), ShieldState.ACTIVE); //tests if the server is in playPowerCard - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),playPowerCardState); + assertEquals(turnState.getCurrentState(), playPowerCardState); } /** @@ -1169,31 +1165,31 @@ public void testLoseShield() { serverGameLogic.getGameState().getTurnState().getChoosePieceState().setCurrentState(selectPieceState); //tests if the server is in selectPieces - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),choosePieceState); - assertEquals(choosePieceState.getCurrentState(),selectPieceState); + assertEquals(turnState.getCurrentState(), choosePieceState); + assertEquals(choosePieceState.getCurrentState(), selectPieceState); //send requestDice-message - serverGameLogic.received(new RequestDieMessage(),IDClient); + serverGameLogic.received(new RequestDieMessage(), IDClient); //send requestMove-message for clientPiece0 - serverGameLogic.received(new RequestMoveMessage(pieceClient0),IDClient); + serverGameLogic.received(new RequestMoveMessage(pieceClient0), IDClient); //tests if the server is in animation-state - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), gameState.getAnimationState()); //send 3 animationEndMessage - serverGameLogic.received(new AnimationEndMessage(),IDClient); - serverGameLogic.received(new AnimationEndMessage(),IDHost); - serverGameLogic.received(new AnimationEndMessage(),IDCyber); + serverGameLogic.received(new AnimationEndMessage(), IDClient); + serverGameLogic.received(new AnimationEndMessage(), IDHost); + serverGameLogic.received(new AnimationEndMessage(), IDCyber); //test for new Player - assertEquals(serverGameLogic.getGame().getActiveColor(),hostColor); + assertEquals(serverGameLogic.getGame().getActiveColor(), hostColor); //tests, if the shieldState is NONE - assertEquals(pieceHost1.getShield(),ShieldState.NONE); + assertEquals(pieceHost1.getShield(), ShieldState.NONE); } /** @@ -1211,10 +1207,10 @@ public void testFinishedPiece() { serverGameLogic.getGameState().getTurnState().getChoosePieceState().setCurrentState(selectPieceState); //tests if the server is in selectPieces - assertEquals(serverGameLogic.getCurrentState(),gameState); + assertEquals(serverGameLogic.getCurrentState(), gameState); assertEquals(gameState.getCurrentState(), turnState); - assertEquals(turnState.getCurrentState(),choosePieceState); - assertEquals(choosePieceState.getCurrentState(),selectPieceState); + assertEquals(turnState.getCurrentState(), choosePieceState); + assertEquals(choosePieceState.getCurrentState(), selectPieceState); //sets the active color to client game.setActiveColor(clientColor); @@ -1222,14 +1218,14 @@ public void testFinishedPiece() { //set the dice to 2 game.setDie(die2); //sends the requestDie-Message - serverGameLogic.received(new RequestDieMessage(),IDClient); + serverGameLogic.received(new RequestDieMessage(), IDClient); //sends the requestMove-Message - serverGameLogic.received(new RequestMoveMessage(pieceClient1),IDClient); + serverGameLogic.received(new RequestMoveMessage(pieceClient1), IDClient); //tests if the Piece is in the final position and is marked as home-finished assertTrue(game.getPlayerByColor(clientColor).getHomeNodes()[3].isOccupied()); assertEquals(game.getPlayerByColor(clientColor).getHomeNodes()[3].getOccupant(), pieceClient1); - assertEquals(pieceClient1.getState(),PieceState.HOMEFINISHED); + assertEquals(pieceClient1.getState(), PieceState.HOMEFINISHED); } } diff --git a/Projekte/mdga/model/src/test/java/pp/mdga/server/serverState/ServerStateTest.java b/Projekte/mdga/model/src/test/java/pp/mdga/server/serverState/ServerStateTest.java index 87a91197..07807c34 100644 --- a/Projekte/mdga/model/src/test/java/pp/mdga/server/serverState/ServerStateTest.java +++ b/Projekte/mdga/model/src/test/java/pp/mdga/server/serverState/ServerStateTest.java @@ -2,20 +2,29 @@ //TODO important: set activePlayer, setPlayers, setPieces, setBonusCards -import org.junit.*; +import org.junit.Before; +import org.junit.Test; import pp.mdga.game.*; import pp.mdga.game.card.PowerCard; -import pp.mdga.message.server.ServerMessage; import pp.mdga.message.client.*; -import pp.mdga.server.*; -import pp.mdga.server.automaton.*; -import pp.mdga.server.automaton.game.*; +import pp.mdga.message.server.ServerMessage; +import pp.mdga.server.ServerGameLogic; +import pp.mdga.server.ServerSender; +import pp.mdga.server.automaton.CeremonyState; +import pp.mdga.server.automaton.GameState; +import pp.mdga.server.automaton.InterruptState; +import pp.mdga.server.automaton.LobbyState; +import pp.mdga.server.automaton.game.AnimationState; +import pp.mdga.server.automaton.game.DetermineStartPlayerState; +import pp.mdga.server.automaton.game.TurnState; import pp.mdga.server.automaton.game.turn.*; import pp.mdga.server.automaton.game.turn.choosepiece.*; -import pp.mdga.server.automaton.game.turn.rolldice.*; +import pp.mdga.server.automaton.game.turn.rolldice.FirstRollState; +import pp.mdga.server.automaton.game.turn.rolldice.SecondRollState; +import pp.mdga.server.automaton.game.turn.rolldice.ThirdRollState; import pp.mdga.visitor.Visitor; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; /** * this test-class tests the Testcases T132-T169 @@ -98,7 +107,6 @@ public class ServerStateTest { private WaitingPieceState waitingPieceState; - /** * this method is used to initialize the attributes of this test-class */ @@ -172,14 +180,14 @@ public void accept(Visitor visitor) { } }; - lobbyState = serverGameLogic.getLobbyState(); - gameState = serverGameLogic.getGameState(); - ceremonyState = serverGameLogic.getCeremonyState(); - interruptState = serverGameLogic.getInterruptState(); + lobbyState = serverGameLogic.getLobbyState(); + gameState = serverGameLogic.getGameState(); + ceremonyState = serverGameLogic.getCeremonyState(); + interruptState = serverGameLogic.getInterruptState(); - determineStartPlayerState = gameState.getDetermineStartPlayerState(); - turnState = gameState.getTurnState(); - animationState = gameState.getAnimationState(); + determineStartPlayerState = gameState.getDetermineStartPlayerState(); + turnState = gameState.getTurnState(); + animationState = gameState.getAnimationState(); animationEnd = new AnimationEndMessage(); @@ -428,7 +436,7 @@ public void testCeremonyToServerStateEndState() { /** * this method tests that the server stays in DetermineStartPlayer, when issued messages - * + *

* serverStateTest 10 */ @Test @@ -467,7 +475,7 @@ public void testDetermineStartPlayerToDetermineStartPlayer1() { /** * this method tests that the server stays in DetermineStartPlayer, when all players are ranked and two of the highest are even - * + *

* serverStateTest 11 */ @Test @@ -801,7 +809,7 @@ public void testMovePieceToFirstRoll() { assertEquals(rollDiceState.getCurrentState(), firstRollState); //tests if the activeColor is still Host - assertEquals(game.getActiveColor(),playerHostColor); + assertEquals(game.getActiveColor(), playerHostColor); } /** From f8a021b310ae6eba7ad12c780926286f04cebdfe Mon Sep 17 00:00:00 2001 From: Felix Koppe Date: Wed, 11 Dec 2024 08:40:31 +0100 Subject: [PATCH 02/14] Fix error in notification syncronizer --- .../main/java/pp/mdga/client/NotificationSynchronizer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java index fb74e3d4..7fb06091 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java @@ -156,7 +156,10 @@ private void handleGame(Notification notification) { int v5 = ceremonyNotification.getNodesMoved().get(i); int v6 = ceremonyNotification.getBonusNodes().get(i); - ceremonyView.addCeremonyParticipant(color, i, name); + if(i < size - 1) { + ceremonyView.addCeremonyParticipant(color, i + 1, name); + } + ceremonyView.addStatisticsRow(name, v1, v2, v3, v4, v5, v6); } } else if (notification instanceof DiceNowNotification) { From f251bad97f809587a269690c65a831962715bf2e Mon Sep 17 00:00:00 2001 From: Cedric Beck Date: Wed, 11 Dec 2024 08:59:21 +0000 Subject: [PATCH 03/14] fixed node selected after clear --- .../src/main/java/pp/mdga/client/board/BoardHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java index 499874d0..a0ae295d 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java @@ -718,14 +718,14 @@ public void clearSelectable() { p.unHighlight(); p.setSelectable(false); p.setHoverable(false); - if (selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unSelect(); - if (selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unHighlight(); } for (PieceControl p : selectableOwnPieces) { p.unSelect(); p.unHighlight(); p.setSelectable(false); p.setHoverable(false); + if (selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unSelect(); + if (selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unHighlight(); } for (NodeControl n : outlineNodes) { n.deOutline(); From c1641cdac1ab1e39033142adb1861f48aff4d45a Mon Sep 17 00:00:00 2001 From: Hanno Fleischer Date: Wed, 11 Dec 2024 10:54:50 +0100 Subject: [PATCH 04/14] added the possibility when someone rolls a 6 and then has no valid move he can dice again --- .../turnstate/choosepiecestate/NoPieceState.java | 7 +++++++ .../game/turn/choosepiece/NoTurnState.java | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java index 5c1d5006..cf3860c0 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java @@ -4,10 +4,12 @@ import pp.mdga.client.ClientState; import pp.mdga.client.gamestate.turnstate.ChoosePieceState; import pp.mdga.game.Piece; +import pp.mdga.message.server.DiceNowMessage; import pp.mdga.message.server.EndOfTurnMessage; import pp.mdga.message.server.SelectPieceMessage; import pp.mdga.message.server.StartPieceMessage; import pp.mdga.message.server.WaitPieceMessage; +import pp.mdga.notification.DiceNowNotification; import pp.mdga.notification.SelectableMoveNotification; import java.util.ArrayList; @@ -74,4 +76,9 @@ public void received(EndOfTurnMessage msg) { logic.getGame().setTurboFlag(false); parent.getParent().getParent().setState(parent.getParent().getParent().getWaiting()); } + + @Override + public void received(DiceNowMessage msg){ + parent.getParent().setState(parent.getParent().getRollDice()); + } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoTurnState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoTurnState.java index 94463566..c89cc224 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoTurnState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoTurnState.java @@ -1,7 +1,9 @@ package pp.mdga.server.automaton.game.turn.choosepiece; +import pp.mdga.Resources; import pp.mdga.game.Color; import pp.mdga.message.server.ActivePlayerMessage; +import pp.mdga.message.server.DiceNowMessage; import pp.mdga.message.server.EndOfTurnMessage; import pp.mdga.server.ServerGameLogic; import pp.mdga.server.automaton.game.turn.ChoosePieceState; @@ -22,6 +24,11 @@ public NoTurnState(ChoosePieceState choosePieceAutomaton, ServerGameLogic logic) super(choosePieceAutomaton, logic); } + /** + * This method is used to end the turn of the active player and determine a new active player + * + * @param color the color of the current active player + */ private void setActivePlayer(Color color) { if (!logic.getGame().getPlayerByColor(color.next(logic.getGame())).isFinished()) { logic.getGame().setActiveColor(logic.getGame().getActiveColor().next(logic.getGame())); @@ -38,8 +45,13 @@ private void setActivePlayer(Color color) { @Override public void enter() { LOGGER.log(System.Logger.Level.DEBUG, "Entered NoTurnState state."); - logic.getServerSender().send(logic.getGame().getActivePlayerId(), new EndOfTurnMessage()); - setActivePlayer(logic.getGame().getActiveColor()); + if (logic.getGame().getDiceEyes() == Resources.MAX_EYES){ + logic.getServerSender().send(logic.getGame().getActivePlayerId(), new DiceNowMessage()); + this.choosePieceAutomaton.getTurnAutomaton().setCurrentState(this.choosePieceAutomaton.getTurnAutomaton().getRollDiceState()); + } else { + logic.getServerSender().send(logic.getGame().getActivePlayerId(), new EndOfTurnMessage()); + setActivePlayer(logic.getGame().getActiveColor()); + } } /** From 574f8bb68167b962b8de32f64e1e304b0d5176f8 Mon Sep 17 00:00:00 2001 From: Hanno Fleischer Date: Wed, 11 Dec 2024 12:00:39 +0100 Subject: [PATCH 05/14] added java docs --- .../client/ceremonystate/CeremonyStates.java | 7 + .../client/ceremonystate/PodiumState.java | 15 ++ .../client/ceremonystate/StatisticsState.java | 16 ++ .../mdga/client/dialogstate/DialogStates.java | 6 + .../mdga/client/dialogstate/LobbyState.java | 60 +++++- .../mdga/client/gamestate/AnimationState.java | 15 ++ .../gamestate/DetermineStartPlayerState.java | 73 ++++++++ .../pp/mdga/client/gamestate/GameStates.java | 28 +++ .../mdga/client/gamestate/SpectatorState.java | 40 +++- .../pp/mdga/client/gamestate/TurnState.java | 176 +++++++++++++++++- .../mdga/client/gamestate/WaitingState.java | 40 ++++ .../DetermineStartPlayerStates.java | 7 + .../RollRankingDiceState.java | 20 ++ .../WaitRankingState.java | 33 ++++ .../gamestate/turnstate/ChoosePieceState.java | 65 +++++++ .../gamestate/turnstate/MovePieceState.java | 40 ++++ .../turnstate/PlayPowerCardState.java | 20 ++ .../gamestate/turnstate/PowerCardState.java | 63 ++++++- .../gamestate/turnstate/RollDiceState.java | 43 +++++ .../gamestate/turnstate/TurnStates.java | 7 + .../choosepiecestate/ChoosePieceStates.java | 7 + .../choosepiecestate/NoPieceState.java | 33 ++++ .../choosepiecestate/SelectPieceState.java | 27 +++ .../choosepiecestate/StartPieceState.java | 28 ++- .../choosepiecestate/WaitingPieceState.java | 22 +++ .../powercardstate/PowerCardStates.java | 7 + .../turnstate/powercardstate/ShieldState.java | 28 ++- .../turnstate/powercardstate/SwapState.java | 32 ++++ 28 files changed, 946 insertions(+), 12 deletions(-) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/CeremonyStates.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/CeremonyStates.java index b60ed5e9..9fe9de1f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/CeremonyStates.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/CeremonyStates.java @@ -4,6 +4,13 @@ import pp.mdga.client.ClientState; public abstract class CeremonyStates extends ClientState { + + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ protected CeremonyStates(ClientState parent, ClientGameLogic logic) { super(parent, logic); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/PodiumState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/PodiumState.java index 5844e381..a32811ce 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/PodiumState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/PodiumState.java @@ -8,21 +8,36 @@ public class PodiumState extends CeremonyStates { private final CeremonyState parent; + /** + * This constructs a new PodiumState. + * + * @param parent the parent state + * @param logic the client game logic + */ public PodiumState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (CeremonyState) parent; } + /** + * This method will be called whenever the client enters the PodiumState. + */ @Override public void enter() { } + /** + * This method will be called whenever the client exits the PodiumState. + */ @Override public void exit() { } + /** + * This method will be called whenever the client selects the next button. + */ @Override public void selectNext() { parent.setState(parent.getStatisticsState()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java index 3dcbd1a5..2d3bc943 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java @@ -4,20 +4,36 @@ import pp.mdga.client.ClientState; public class StatisticsState extends CeremonyStates { + + /** + * This constructs a new StatisticsState. + * + * @param parent the parent state + * @param logic the client game logic + */ public StatisticsState(ClientState parent, ClientGameLogic logic) { super(parent, logic); } + /** + * This method will be called whenever the client enters the StatisticsState. + */ @Override public void enter() { } + /** + * This method will be called whenever the client exits the StatisticsState. + */ @Override public void exit() { } + /** + * This method will be called whenever the client selects the next button. + */ @Override public void selectNext() { logic.setState(logic.getDialogs()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/DialogStates.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/DialogStates.java index 12a4ad8a..0a62dba8 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/DialogStates.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/DialogStates.java @@ -5,6 +5,12 @@ public abstract class DialogStates extends ClientState { + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public DialogStates(ClientState parent, ClientGameLogic logic) { super(parent, logic); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/LobbyState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/LobbyState.java index 499bcc08..a7c07a31 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/LobbyState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/dialogstate/LobbyState.java @@ -19,20 +19,35 @@ public class LobbyState extends DialogStates { private final DialogsState parent; + /** + * The constructor of the LobbyState. + * + * @param parent the parent state + * @param logic the client game logic + */ public LobbyState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (DialogsState) parent; } + /** + * This method will be called whenever the client enters the LobbyState. + */ @Override public void enter() { logic.send(new JoinedLobbyMessage(logic.getOwnPlayerName())); } + /** + * This method will be called whenever the client exits the LobbyState. + */ @Override public void exit() { } + /** + * This method will be called whenever the client selects the leave button. + */ @Override public void selectLeave() { parent.setState(parent.getStartDialog()); @@ -40,26 +55,45 @@ public void selectLeave() { logic.send(new LeaveGameMessage()); } + /** + * This method will be called whenever the client selects the color of the player. + * + * @param color the color of the player + */ @Override public void selectTSK(Color color) { logic.send(new SelectTSKMessage(color)); } + /** + * This method will be called whenever the client deselects the color of the player. + * + * @param color the color of the player + */ @Override public void deselectTSK(Color color) { logic.send(new DeselectTSKMessage(color)); } + /** + * This method will be called whenever the client selects the ready button. + */ @Override public void selectReady() { logic.send(new LobbyReadyMessage()); } + /** + * This method will be called whenever the client selects the unready button. + */ @Override public void selectUnready() { logic.send(new LobbyNotReadyMessage()); } + /** + * This method will be called whenever the client selects the start button. + */ @Override public void selectStart() { if (logic.isHost() && logic.getGame().areAllReady()) { @@ -70,6 +104,11 @@ public void selectStart() { } } + /** + * This method will be called whenever the client receives a message. + * + * @param msg the message which was received + */ @Override public void received(ServerStartGameMessage msg) { for (Player player : msg.getPlayers()) { @@ -91,6 +130,11 @@ public void received(ServerStartGameMessage msg) { logic.setState(logic.getGameState()); } + /** + * This method will be called whenever the client receives a message. + * + * @param msg the message which was received + */ @Override public void received(LobbyPlayerJoinedMessage msg) { if (msg.getPlayer().getName().equals(logic.getOwnPlayerName())) { @@ -105,6 +149,11 @@ public void received(LobbyPlayerJoinedMessage msg) { logic.getGame().getPlayers().put(msg.getId(), msg.getPlayer()); } + /** + * This method will be called whenever the client receives a message. + * + * @param msg the message which was received + */ @Override public void received(UpdateTSKMessage msg) { if (msg.isTaken()) { @@ -116,15 +165,24 @@ public void received(UpdateTSKMessage msg) { logic.getGame().getPlayers().get(msg.getId()).setColor(msg.getColor()); } + /** + * This method will be called whenever the client receives a message. + * + * @param msg the message which was received + */ @Override public void received(LobbyPlayerLeaveMessage msg) { logic.addNotification(new TskUnselectNotification(logic.getGame().getPlayers().get(msg.getId()).getColor())); logic.getGame().getPlayers().remove(msg.getId()); } + /** + * This method will be called whenever the client receives a message. + * + * @param msg the message which was received + */ @Override public void received(UpdateReadyMessage msg) { - //TODO server sendet kein update on UNready logic.addNotification(new LobbyReadyNotification(logic.getGame().getPlayers().get(msg.getPlayerId()).getColor(), msg.isReady())); logic.getGame().getPlayers().get(msg.getPlayerId()).setReady(msg.isReady()); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java index 616ad863..9f36617f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java @@ -11,20 +11,35 @@ public class AnimationState extends GameStates { private final GameState parent; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public AnimationState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (GameState) parent; } + /** + * Enters the state. + */ @Override public void enter() { } + /** + * Exits the state. + */ @Override public void exit() { } + /** + * Selects the animation end. + */ @Override public void selectAnimationEnd() { logic.send(new AnimationEndMessage()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/DetermineStartPlayerState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/DetermineStartPlayerState.java index 46e0596d..d1d4cb39 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/DetermineStartPlayerState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/DetermineStartPlayerState.java @@ -18,41 +18,83 @@ public class DetermineStartPlayerState extends GameStates { private final WaitRankingState waitRankingState = new WaitRankingState(this, logic); private final Intro intro = new Intro(this, logic); + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public DetermineStartPlayerState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (GameState) parent; } + /** + * Gets the roll ranking dice. + * + * @return the roll ranking dice + */ public RollRankingDiceState getRollRankingDice() { return rollRankingDiceState; } + /** + * Gets the wait ranking. + * + * @return the wait ranking + */ public WaitRankingState getWaitRanking() { return waitRankingState; } + /** + * Gets the state. + * + * @return the state + */ public DetermineStartPlayerStates getState() { return state; } + /** + * Gets the intro. + * + * @return the intro + */ public Intro getIntro() { return intro; } + /** + * Gets the parent state. + * + * @return the parent state + */ public GameState getParent() { return parent; } + /** + * Enters the state. + */ @Override public void enter() { this.setState(this.rollRankingDiceState); } + /** + * Exits the state. + */ @Override public void exit() { state = null; } + /** + * Sets the state. + * + * @param state the state + */ public void setState(DetermineStartPlayerStates state) { System.out.println("CLIENT STATE old: " + this.state + " new: " + state); if (this.state != null) { @@ -62,36 +104,67 @@ public void setState(DetermineStartPlayerStates state) { this.state.enter(); } + /** + * Selects the dice. + */ @Override public void selectDice() { state.selectDice(); } + /** + * Selects the animation end. + */ @Override public void selectAnimationEnd() { state.selectAnimationEnd(); } + /** + * Receives the die message. + * + * @param msg the die message + */ @Override public void received(DieMessage msg) { state.received(msg); } + /** + * Receives the ceremony message. + * + * @param msg the ceremony message + */ @Override public void received(DiceNowMessage msg) { state.received(msg); } + /** + * Receives the ranking roll again message. + * + * @param msg the ranking roll again message + */ @Override public void received(RankingRollAgainMessage msg) { state.received(msg); } + /** + * Receives the ranking response message. + * + * @param msg the ranking response message + */ @Override public void received(RankingResponseMessage msg) { state.received(msg); } + /** + * Receives the ranking result message. + * + * @param msg the ranking result message + */ @Override public void received(ActivePlayerMessage msg) { state.received(msg); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/GameStates.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/GameStates.java index 172a9be8..9b0cf0a2 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/GameStates.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/GameStates.java @@ -14,10 +14,21 @@ public abstract class GameStates extends ClientState { private final System.Logger LOGGER = System.getLogger(this.getClass().getName()); + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public GameStates(ClientState parent, ClientGameLogic logic) { super(parent, logic); } + /** + * Handles the power card. + * + * @param msg the play card message + */ protected void handlePowerCard(PlayCardMessage msg) { if (msg.getCard().getCard().equals(BonusCard.TURBO)) { logic.getGame().setTurboFlag(true); @@ -30,6 +41,11 @@ protected void handlePowerCard(PlayCardMessage msg) { logic.getGame().getDiscardPile().add(msg.getCard()); } + /** + * Handles the shield. + * + * @param uuid the uuid + */ private void handleShield(UUID uuid) { Board board = logic.getGame().getBoard(); Piece piece = logic.getGame().getPieceThroughUUID(uuid); @@ -44,6 +60,12 @@ private void handleShield(UUID uuid) { } } + /** + * Swaps the pieces. + * + * @param messageOwn the own piece + * @param messageEnemy the enemy piece + */ private void swapPieces(Piece messageOwn, Piece messageEnemy) { //swap Pieces in Model Board board = logic.getGame().getBoard(); @@ -61,6 +83,12 @@ private void swapPieces(Piece messageOwn, Piece messageEnemy) { } + /** + * Checks the shield after the swap. + * + * @param node the node + * @param piece the piece + */ private void checkShieldAfterSwap(Node node, Piece piece) { if (node.isStart()) { if (piece.isShielded()) { diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java index 5c2629f3..9b123bc9 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java @@ -15,25 +15,45 @@ public class SpectatorState extends GameStates { private final GameState parent; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public SpectatorState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (GameState) parent; } + /** + * Enters the state. + */ @Override public void enter() { } + /** + * Exits the state. + */ @Override public void exit() { } + /** + * Receives the Ceremony Message. + */ @Override public void received(CeremonyMessage msg) { logic.setState(logic.getCeremony()); } + /** + * Receives the Draw card message. + * + * @param msg the draw card message + */ @Override public void received(DrawCardMessage msg) { logic.getGame().getActivePlayer().addHandCard(msg.getCard()); @@ -46,17 +66,19 @@ public void received(DrawCardMessage msg) { logic.getGame().getGameStatistics().increaseActivatedBonusNodes(); } + /** + * Receives the Die Message. + */ @Override public void received(DieMessage msg) { - //logic.getGame().setDiceEyes(msg.getDiceEye()); -// logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), logic.getGame().getDiceEyes(), logic.getGame().getDiceEyes() * logic.getGame().getDiceModifier())); - if (msg.getDiceEye() == 6) { - logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getPlayerStatistic().increaseDiced6(); - logic.getGame().getGameStatistics().increaseDiced6(); - } + logic.getGame().setDiceEyes(msg.getDiceEye()); + logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), logic.getGame().getDiceEyes(), logic.getGame().getDiceEyes() * logic.getGame().getDiceModifier())); parent.setState(parent.getAnimation()); } + /** + * Receives the PlayCardMessage Message. + */ @Override public void received(PlayCardMessage msg) { logic.addNotification(new PlayCardNotification(logic.getGame().getActiveColor(), msg.getCard().getCard())); @@ -66,6 +88,9 @@ public void received(PlayCardMessage msg) { parent.setState(parent.getAnimation()); } + /** + * Receives the ActivePlayerMessage Message. + */ @Override public void received(ActivePlayerMessage msg) { logic.addNotification(new ActivePlayerNotification(msg.getColor())); @@ -73,6 +98,9 @@ public void received(ActivePlayerMessage msg) { parent.setState(parent.getAnimation()); } + /** + * Receives the MoveMessage Message. + */ @Override public void received(MoveMessage msg) { Piece piece = logic.getGame().getPieceThroughUUID(msg.getPiece().getUuid()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/TurnState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/TurnState.java index 835a2a9c..35a29baa 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/TurnState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/TurnState.java @@ -3,11 +3,30 @@ import pp.mdga.client.ClientGameLogic; import pp.mdga.client.ClientState; import pp.mdga.client.GameState; -import pp.mdga.client.gamestate.turnstate.*; +import pp.mdga.client.gamestate.turnstate.ChoosePieceState; +import pp.mdga.client.gamestate.turnstate.MovePieceState; +import pp.mdga.client.gamestate.turnstate.PlayPowerCardState; +import pp.mdga.client.gamestate.turnstate.PowerCardState; +import pp.mdga.client.gamestate.turnstate.RollDiceState; +import pp.mdga.client.gamestate.turnstate.TurnStates; import pp.mdga.game.BonusCard; import pp.mdga.game.Piece; import pp.mdga.game.ShieldState; -import pp.mdga.message.server.*; +import pp.mdga.message.server.CeremonyMessage; +import pp.mdga.message.server.ChoosePieceStateMessage; +import pp.mdga.message.server.DiceAgainMessage; +import pp.mdga.message.server.DiceNowMessage; +import pp.mdga.message.server.DieMessage; +import pp.mdga.message.server.EndOfTurnMessage; +import pp.mdga.message.server.MoveMessage; +import pp.mdga.message.server.NoTurnMessage; +import pp.mdga.message.server.PlayCardMessage; +import pp.mdga.message.server.PossibleCardsMessage; +import pp.mdga.message.server.PossiblePieceMessage; +import pp.mdga.message.server.SelectPieceMessage; +import pp.mdga.message.server.SpectatorMessage; +import pp.mdga.message.server.StartPieceMessage; +import pp.mdga.message.server.WaitPieceMessage; import pp.mdga.notification.RemoveShieldNotification; public class TurnState extends GameStates { @@ -22,11 +41,20 @@ public class TurnState extends GameStates { private final RollDiceState rollDiceState = new RollDiceState(this, logic); private boolean canChangeTurbo = false; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public TurnState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (GameState) parent; } + /** + * Enters the state. + */ @Override public void enter() { logic = logic; @@ -40,11 +68,19 @@ public void enter() { this.setState(this.powerCardState); } + /** + * Exits the state. + */ @Override public void exit() { state = null; } + /** + * Sets the state. + * + * @param state the state + */ public void setState(TurnStates state) { System.out.println("CLIENT STATE old: " + this.state + " new: " + state); if (this.state != null) { @@ -54,133 +90,269 @@ public void setState(TurnStates state) { this.state = state; } + /** + * Selects the dice. + */ @Override public void selectDice() { state.selectDice(); } + /** + * Selects the piece. + * + * @param piece the piece + */ @Override public void selectPiece(Piece piece) { state.selectPiece(piece); } + /** + * Selects the card. + * + * @param card the card + */ @Override public void selectCard(BonusCard card) { state.selectCard(card); } + /** + * Selects the animation end. + */ @Override public void selectAnimationEnd() { state.selectAnimationEnd(); } + /** + * Receives the select piece message. + * + * @param msg the select piece message + */ @Override public void received(SelectPieceMessage msg) { state.received(msg); } + /** + * Receives the wait piece message. + * + * @param msg the wait piece message + */ @Override public void received(WaitPieceMessage msg) { state.received(msg); } + /** + * Receives the start piece message. + * + * @param msg the start piece message + */ @Override public void received(StartPieceMessage msg) { state.received(msg); } + /** + * Receives the NoTurnMessage message. + * + * @param msg the NoTurnMessage message + */ @Override public void received(NoTurnMessage msg) { state.received(msg); } + /** + * Receives the MoveMessage message. + * + * @param msg the MoveMessage message + */ @Override public void received(MoveMessage msg) { state.received(msg); } + /** + * Receives the CeremonyMessage message. + * + * @param msg the CeremonyMessage message + */ @Override public void received(CeremonyMessage msg) { state.received(msg); } + /** + * Receives the EndOfTurnMessage message. + * + * @param msg the EndOfTurnMessage message + */ @Override public void received(EndOfTurnMessage msg) { state.received(msg); } + /** + * Receives the SpectatorMessage message. + * + * @param msg the SpectatorMessage message + */ @Override public void received(SpectatorMessage msg) { state.received(msg); } + /** + * Receives the DiceAgainMessage message. + * + * @param msg the DiceAgainMessage message + */ @Override public void received(DiceAgainMessage msg) { state.received(msg); } + /** + * Receives the PossibleCardsMessage message. + * + * @param msg the PossibleCardsMessage message + */ @Override public void received(PossibleCardsMessage msg) { state.received(msg); } + /** + * Receives the PlayCardMessage message. + * + * @param msg the PlayCardMessage message + */ @Override public void received(PlayCardMessage msg) { state.received(msg); } + /** + * Receives the DiceNow message. + * + * @param msg the DiceNow message + */ @Override public void received(DiceNowMessage msg) { state.received(msg); } + /** + * Receives the DieMessage message. + * + * @param msg the DieMessage message + */ @Override public void received(DieMessage msg) { state.received(msg); } + /** + * Receives the PossiblePieceMessage message. + * + * @param msg the PossiblePieceMessage message + */ @Override public void received(PossiblePieceMessage msg) { state.received(msg); } + /** + * Receives the ChoosePieceStateMessage message. + * + * @param msg the ChoosePieceStateMessage message + */ @Override public void received(ChoosePieceStateMessage msg) { state.received(msg); } + /** + * Gets the ChoosePieceState. + * + * @return the ChoosePieceState + */ public ChoosePieceState getChoosePiece() { return choosePieceState; } + /** + * Gets the MovePieceState. + * + * @return the MovePieceState + */ public MovePieceState getMovePiece() { return movePieceState; } + /** + * Gets the PlayPowerCardState. + * + * @return the PlayPowerCardState + */ public PlayPowerCardState getPlayPowerCard() { return playPowerCardState; } + /** + * Gets the PowerCardState. + * + * @return the PowerCardState + */ public PowerCardState getPowerCard() { return powerCardState; } + /** + * Gets the RollDiceState. + * + * @return the RollDiceState + */ public RollDiceState getRollDice() { return rollDiceState; } + /** + * Gets the parent GameState. + * + * @return the parent GameState + */ public GameState getParent() { return parent; } + /** + * Gets the current TurnStates. + * + * @return the current TurnStates + */ public TurnStates getState() { return state; } + /** + * Checks if turbo can be changed. + * + * @return true if turbo can be changed, false otherwise + */ public boolean isCanChangeTurbo() { return canChangeTurbo; } + /** + * Sets the turbo change flag. + * + * @param canChangeTurbo the new value for the turbo change flag + */ public void setCanChangeTurbo(boolean canChangeTurbo) { this.canChangeTurbo = canChangeTurbo; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java index 5496f6ca..615f2fcc 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java @@ -10,31 +10,56 @@ import pp.mdga.message.server.*; import pp.mdga.notification.*; +/** + * Represents the waiting state in the game. + */ public class WaitingState extends GameStates { private final GameState parent; private final System.Logger LOGGER = System.getLogger(this.getClass().getName()); + /** + * Constructs a new WaitingState. + * + * @param parent the parent state + * @param logic the game logic + */ public WaitingState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (GameState) parent; } + /** + * Called when entering the waiting state. + */ @Override public void enter() { } + /** + * Called when exiting the waiting state. + */ @Override public void exit() { } + /** + * Handles the reception of a CeremonyMessage. + * + * @param msg the ceremony message + */ @Override public void received(CeremonyMessage msg) { logic.setState(logic.getCeremony()); } + /** + * Handles the reception of a DieMessage. + * + * @param msg the die message + */ @Override public void received(DieMessage msg) { logic.getGame().setDiceEyes(msg.getDiceEye()); @@ -51,6 +76,11 @@ public void received(DieMessage msg) { } } + /** + * Handles the reception of a PlayCardMessage. + * + * @param msg the play card message + */ @Override public void received(PlayCardMessage msg) { logic.addNotification(new PlayCardNotification(logic.getGame().getActiveColor(), msg.getCard().getCard())); @@ -60,6 +90,11 @@ public void received(PlayCardMessage msg) { parent.setState(parent.getAnimation()); } + /** + * Handles the reception of an ActivePlayerMessage. + * + * @param msg the active player message + */ @Override public void received(ActivePlayerMessage msg) { logic.addNotification(new ActivePlayerNotification(msg.getColor())); @@ -76,6 +111,11 @@ public void received(ActivePlayerMessage msg) { } } + /** + * Handles the reception of a MoveMessage. + * + * @param msg the move message + */ @Override public void received(MoveMessage msg) { Piece piece = logic.getGame().getPieceThroughUUID(msg.getPiece().getUuid()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/DetermineStartPlayerStates.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/DetermineStartPlayerStates.java index 1ec1ac4d..938c6420 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/DetermineStartPlayerStates.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/DetermineStartPlayerStates.java @@ -5,6 +5,13 @@ import pp.mdga.client.gamestate.GameStates; public abstract class DetermineStartPlayerStates extends GameStates { + + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public DetermineStartPlayerStates(ClientState parent, ClientGameLogic logic) { super(parent, logic); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/RollRankingDiceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/RollRankingDiceState.java index 4b7fcbde..38f4a2bc 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/RollRankingDiceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/RollRankingDiceState.java @@ -15,23 +15,38 @@ public class RollRankingDiceState extends DetermineStartPlayerStates { private final DetermineStartPlayerState parent; private boolean isRolled = false; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public RollRankingDiceState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (DetermineStartPlayerState) parent; } + /** + * Enters the state. + */ @Override public void enter() { LOGGER.log(System.Logger.Level.INFO, "Entering RollRankingDiceState"); logic.addNotification(new DiceNowNotification()); } + /** + * Exits the state. + */ @Override public void exit() { LOGGER.log(System.Logger.Level.INFO, "Exiting RollRankingDiceState"); isRolled = false; } + /** + * Selects the dice. + */ @Override public void selectDice() { if (!isRolled) { @@ -40,6 +55,11 @@ public void selectDice() { } } + /** + * This method is called when the server sends a DieMessage. + * + * @param msg the DieMessage + */ @Override public void received(DieMessage msg) { parent.setState(parent.getWaitRanking()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/WaitRankingState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/WaitRankingState.java index 6077d5d1..d9eebd58 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/WaitRankingState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/determinestartplayerstate/WaitRankingState.java @@ -20,11 +20,20 @@ public class WaitRankingState extends DetermineStartPlayerStates { private final DetermineStartPlayerState parent; private boolean canChange = false; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public WaitRankingState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (DetermineStartPlayerState) parent; } + /** + * Changes the state to the intro state. + */ private void changeToIntro() { if (!canChange) { canChange = true; @@ -33,22 +42,38 @@ private void changeToIntro() { parent.setState(parent.getIntro()); } + /** + * Enters the state. + */ @Override public void enter() { LOGGER.log(System.Logger.Level.INFO, "Entering WaitRankingState"); } + /** + * Exits the state. + */ @Override public void exit() { canChange = false; LOGGER.log(System.Logger.Level.INFO, "Exiting WaitRankingState"); } + /** + * This method is called when the server sends a DiceNowMessage. + * + * @param msg the DiceNowMessage + */ @Override public void received(DiceNowMessage msg) { parent.setState(parent.getRollRankingDice()); } + /** + * This method is called when the server sends a RankingResponseMessage. + * + * @param msg the RankingResponseMessage + */ @Override public void received(RankingResponseMessage msg) { Map rankingResults = new HashMap<>(); @@ -58,12 +83,20 @@ public void received(RankingResponseMessage msg) { logic.addNotification(new RankingResponceNotification(rankingResults)); } + /** + * This method is called when the view has completed the animation. + */ @Override public void selectAnimationEnd() { changeToIntro(); logic.send(new AnimationEndMessage()); } + /** + * This method is called when the server sends an ActivePlayerMessage. + * + * @param msg the ActivePlayerMessage + */ @Override public void received(ActivePlayerMessage msg) { logic.getGame().setActiveColor(msg.getColor()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java index b205b992..bf6058e3 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java @@ -17,22 +17,39 @@ public class ChoosePieceState extends TurnStates { private final StartPieceState startPieceState = new StartPieceState(this, logic); private final WaitingPieceState waitingPieceState = new WaitingPieceState(this, logic); + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public ChoosePieceState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (TurnState) parent; } + /** + * Enters the state. + */ @Override public void enter() { this.setState(this.noPieceState); } + /** + * Exits the state. + */ @Override public void exit() { currentState.exit(); currentState = null; } + /** + * Sets the state. + * + * @param state the state + */ public void setState(ChoosePieceStates state) { System.out.println("CLIENT STATE old: " + this.currentState + " new: " + state); if (currentState != null) { @@ -42,56 +59,104 @@ public void setState(ChoosePieceStates state) { currentState = state; } + /** + * Selects the piece. + * + * @param piece the piece + */ @Override public void selectPiece(Piece piece) { currentState.selectPiece(piece); } + /** + * Receives the select piece message. + * + * @param msg the select piece message + */ @Override public void received(SelectPieceMessage msg) { currentState.received(msg); } + /** + * Receives the wait piece message. + * + * @param msg the wait piece message + */ @Override public void received(WaitPieceMessage msg) { currentState.received(msg); } + /** + * Receives the start piece message. + * + * @param msg the start piece message + */ @Override public void received(StartPieceMessage msg) { currentState.received(msg); } + /** + * Receives the end of turn message. + * + * @param msg the end of turn message + */ @Override public void received(EndOfTurnMessage msg) { currentState.received(msg); } + /** + * Receives the move message. + * + * @param msg the move message + */ @Override public void received(MoveMessage msg) { currentState.received(msg); } + /** + * Returns the no piece state. + */ public NoPieceState getNoPiece() { return noPieceState; } + /** + * Returns the select piece state. + */ public SelectPieceState getSelectPiece() { return selectPieceState; } + /** + * Returns the start piece state. + */ public StartPieceState getStartPiece() { return startPieceState; } + /** + * Returns the waiting piece state. + */ public WaitingPieceState getWaitingPiece() { return waitingPieceState; } + /** + * Returns the current state. + */ public ChoosePieceStates getState() { return currentState; } + /** + * Returns the parent state. + */ public TurnState getParent() { return parent; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/MovePieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/MovePieceState.java index 5e865e36..83b04d5a 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/MovePieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/MovePieceState.java @@ -13,46 +13,86 @@ public class MovePieceState extends TurnStates { private final TurnState parent; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public MovePieceState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (TurnState) parent; } + /** + * Enters the state. + */ @Override public void enter() { } + /** + * Exits the state. + */ @Override public void exit() { } + /** + * Selects the animation end. + */ @Override public void selectAnimationEnd() { logic.send(new AnimationEndMessage()); } + /** + * Receives the ceremony message. + * + * @param msg the ceremony message + */ @Override public void received(CeremonyMessage msg) { logic.setState(logic.getCeremony()); } + /** + * Receives the end of turn message. + * + * @param msg the end of turn message + */ @Override public void received(EndOfTurnMessage msg) { parent.getParent().setState(parent.getParent().getWaiting()); } + /** + * Receives the spectator message. + * + * @param msg the spectator message + */ @Override public void received(SpectatorMessage msg) { parent.getParent().setState(parent.getParent().getSpectator()); } + /** + * Receives the dice now message. + * + * @param msg the dice now message + */ @Override public void received(DiceNowMessage msg) { parent.setState(parent.getRollDice()); } + /** + * Gets the parent state. + * + * @return the parent state + */ public TurnState getParent() { return parent; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PlayPowerCardState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PlayPowerCardState.java index 3cfb80f1..a1a18dd4 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PlayPowerCardState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PlayPowerCardState.java @@ -15,11 +15,20 @@ public class PlayPowerCardState extends TurnStates { private PlayCardMessage playCardMessage; private int extraAnimationCounter = 0; + /** + * Constructor + * + * @param parent parent state + * @param logic game logic + */ public PlayPowerCardState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (TurnState) parent; } + /** + * Enter the state + */ @Override public void enter() { if (playCardMessage.getCard().getCard().equals(BonusCard.SWAP)) { @@ -31,15 +40,26 @@ public void enter() { handlePowerCard(playCardMessage); } + /** + * Exits the state + */ @Override public void exit() { playCardMessage = null; } + /** + * Handle the power card + * + * @param playCardMessage the play card message + */ public void setPlayCard(PlayCardMessage playCardMessage) { this.playCardMessage = playCardMessage; } + /** + * The view has finished its animation + */ @Override public void selectAnimationEnd() { if (extraAnimationCounter > 0) { diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PowerCardState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PowerCardState.java index aeb6a58b..4bcea25b 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PowerCardState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/PowerCardState.java @@ -23,22 +23,38 @@ public class PowerCardState extends TurnStates { private final ShieldState shieldState = new ShieldState(this, logic); private final SwapState swapState = new SwapState(this, logic); - + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public PowerCardState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (TurnState) parent; } + /** + * Enters the state. + */ @Override public void enter() { this.setState(this.choosePowerCardState); } + /** + * Exits the state. + */ public void exit() { state.exit(); state = null; } + /** + * Sets the state. + * + * @param state the state + */ public void setState(PowerCardStates state) { System.out.println("CLIENT STATE old: " + this.state + " new: " + state); @@ -49,52 +65,97 @@ public void setState(PowerCardStates state) { this.state = state; } + /** + * Receives the possible cards message. + * + * @param msg the possible cards message + */ @Override public void received(PossibleCardsMessage msg) { state.received(msg); } + /** + * Receives the play card message. + * + * @param msg the play card message + */ @Override public void received(PlayCardMessage msg) { state.received(msg); } + /** + * Receives the dice now message. + * + * @param msg the dice now message + */ @Override public void received(DiceNowMessage msg) { state.received(msg); } + /** + * Receives the possible piece message. + * + * @param msg the possible piece message + */ @Override public void received(PossiblePieceMessage msg) { state.received(msg); } + /** + * Selects the card. + * + * @param card the card + */ @Override public void selectCard(BonusCard card) { state.selectCard(card); } + /** + * Selects the piece. + * + * @param piece the piece + */ @Override public void selectPiece(Piece piece) { state.selectPiece(piece); } + /** + * Returns the choose power card state. + */ public ChoosePowerCardState getChoosePowerCard() { return choosePowerCardState; } + /** + * Returns the shield state. + */ public ShieldState getShield() { return shieldState; } + /** + * Returns the swap state. + */ public SwapState getSwap() { return swapState; } + /** + * Returns the parent state. + */ public TurnState getParent() { return parent; } + /** + * Returns the state. + */ public PowerCardStates getState() { return state; } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java index e756919e..92c32ecb 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java @@ -17,27 +17,47 @@ public class RollDiceState extends TurnStates { private final TurnState parent; private boolean isRolled = false; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public RollDiceState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (TurnState) parent; } + /** + * Enters the state. + */ @Override public void enter() { isRolled = false; logic.addNotification(new DiceNowNotification()); } + /** + * Exits the state. + */ @Override public void exit() { logic.getGame().setDiceModifier(1); isRolled = false; } + /** + * Gets the parent state. + * + * @return the parent state + */ public TurnState getParent() { return parent; } + /** + * Selects the dice. + */ @Override public void selectDice() { if (!isRolled) { @@ -46,6 +66,11 @@ public void selectDice() { } } + /** + * Receives the die message. + * + * @param msg the die message + */ @Override public void received(DieMessage msg) { logic.getGame().setDiceEyes(msg.getDiceEye()); @@ -58,21 +83,39 @@ public void received(DieMessage msg) { } } + /** + * Selects the animation end. + */ @Override public void selectAnimationEnd() { logic.send(new AnimationEndMessage()); } + /** + * Receives the choose piece state message. + * + * @param msg the choose piece state message + */ @Override public void received(ChoosePieceStateMessage msg) { parent.setState(parent.getChoosePiece()); } + /** + * Receives the no turn message. + * + * @param msg the no turn message + */ @Override public void received(NoTurnMessage msg) { parent.getParent().setState(parent.getParent().getWaiting()); } + /** + * Receives the dice now message. + * + * @param msg the dice now message + */ @Override public void received(DiceNowMessage msg) { isRolled = false; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/TurnStates.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/TurnStates.java index 8029e9e0..bb1f47eb 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/TurnStates.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/TurnStates.java @@ -5,6 +5,13 @@ import pp.mdga.client.gamestate.GameStates; public abstract class TurnStates extends GameStates { + + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public TurnStates(ClientState parent, ClientGameLogic logic) { super(parent, logic); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/ChoosePieceStates.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/ChoosePieceStates.java index 0311ea35..fb01488f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/ChoosePieceStates.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/ChoosePieceStates.java @@ -5,6 +5,13 @@ import pp.mdga.client.gamestate.turnstate.TurnStates; public abstract class ChoosePieceStates extends TurnStates { + + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public ChoosePieceStates(ClientState parent, ClientGameLogic logic) { super(parent, logic); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java index cf3860c0..f269adba 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/NoPieceState.java @@ -23,21 +23,36 @@ public class NoPieceState extends ChoosePieceStates { private final ChoosePieceState parent; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public NoPieceState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (ChoosePieceState) parent; } + /** + * Enters the state. + */ @Override public void enter() { LOGGER.log(System.Logger.Level.INFO, "Entering NoPieceState"); } + /** + * Exits the state. + */ @Override public void exit() { } + /** + * Selects the piece. + */ @Override public void received(SelectPieceMessage msg) { ArrayList pieces = msg.getPieces().stream().map(piece -> logic.getGame().getPieceThroughUUID(piece.getUuid())).collect(Collectors.toCollection(ArrayList::new)); @@ -48,6 +63,9 @@ public void received(SelectPieceMessage msg) { parent.setState(parent.getSelectPiece()); } + /** + * Selects the dice. + */ @Override public void received(WaitPieceMessage msg) { LOGGER.log(System.Logger.Level.INFO, "Received WaitPieceMessage"); @@ -56,6 +74,11 @@ public void received(WaitPieceMessage msg) { parent.setState(parent.getWaitingPiece()); } + /** + * This method is called when the server sends a DiceNowMessage. + * + * @param msg the DiceNowMessage + */ @Override public void received(StartPieceMessage msg) { Piece piece = logic.getGame().getPieceThroughUUID(msg.getPieceIdentifier()); @@ -71,12 +94,22 @@ public void received(StartPieceMessage msg) { parent.setState(parent.getStartPiece()); } + /** + * This method is called when the server sends a DiceNowMessage. + * + * @param msg the DiceNowMessage + */ @Override public void received(EndOfTurnMessage msg) { logic.getGame().setTurboFlag(false); parent.getParent().getParent().setState(parent.getParent().getParent().getWaiting()); } + /** + * This method is called when the server sends a DiceNowMessage. + * + * @param msg the DiceNowMessage + */ @Override public void received(DiceNowMessage msg){ parent.getParent().setState(parent.getParent().getRollDice()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/SelectPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/SelectPieceState.java index d452da5d..59bd1b7c 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/SelectPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/SelectPieceState.java @@ -18,25 +18,47 @@ public class SelectPieceState extends ChoosePieceStates { private ArrayList possiblePieces; private final System.Logger LOGGER = System.getLogger(this.getClass().getName()); + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public SelectPieceState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (ChoosePieceState) parent; } + /** + * Enters the state. + */ @Override public void enter() { } + /** + * Exits the state. + */ @Override public void exit() { possiblePieces = new ArrayList<>(); } + /** + * Sets the possible pieces. + * + * @param possiblePieces the possible pieces + */ public void setPossiblePieces(ArrayList possiblePieces) { this.possiblePieces = possiblePieces; } + /** + * Selects the piece. + * + * @param piece the piece + */ @Override public void selectPiece(Piece piece) { if (possiblePieces.contains(piece)) { @@ -44,6 +66,11 @@ public void selectPiece(Piece piece) { } } + /** + * This method is called when the server sends a MoveMessage. + * + * @param msg the MoveMessage + */ @Override public void received(MoveMessage msg) { Piece piece = logic.getGame().getPieceThroughUUID(msg.getPiece().getUuid()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/StartPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/StartPieceState.java index 1e60f45e..592bf8b9 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/StartPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/StartPieceState.java @@ -17,26 +17,47 @@ public class StartPieceState extends ChoosePieceStates { private final ChoosePieceState parent; private Piece moveablePiece; - + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public StartPieceState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (ChoosePieceState) parent; } + /** + * Enters the state. + */ @Override public void enter() { } + /** + * Exits the state. + */ @Override public void exit() { moveablePiece = null; } + /** + * Sets the moveable piece. + * + * @param moveablePiece the moveable piece + */ public void setMoveablePiece(Piece moveablePiece) { this.moveablePiece = moveablePiece; } + /** + * Selects the piece. + * + * @param piece the piece + */ @Override public void selectPiece(Piece piece) { if (moveablePiece.equals(piece)) { @@ -44,6 +65,11 @@ public void selectPiece(Piece piece) { } } + /** + * Receives the move message. + * + * @param msg the move message + */ @Override public void received(MoveMessage msg) { Piece piece = logic.getGame().getPieceThroughUUID(msg.getPiece().getUuid()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/WaitingPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/WaitingPieceState.java index 80ec310c..40ab704a 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/WaitingPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/choosepiecestate/WaitingPieceState.java @@ -17,25 +17,47 @@ public class WaitingPieceState extends ChoosePieceStates { private final ChoosePieceState parent; private Piece moveablePiece; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public WaitingPieceState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (ChoosePieceState) parent; } + /** + * Enters the state. + */ @Override public void enter() { moveablePiece = null; } + /** + * Exits the state. + */ @Override public void exit() { } + /** + * Sets the moveable piece. + * + * @param piece the moveable piece + */ @Override public void selectPiece(Piece piece) { logic.send(new RequestMoveMessage(piece)); } + /** + * Receives the move message. + * + * @param msg the move message + */ @Override public void received(MoveMessage msg) { Piece pieceToMove = logic.getGame().getPieceThroughUUID(msg.getPiece().getUuid()); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/PowerCardStates.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/PowerCardStates.java index 53482531..d0e0cda9 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/PowerCardStates.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/PowerCardStates.java @@ -5,6 +5,13 @@ import pp.mdga.client.gamestate.turnstate.TurnStates; public abstract class PowerCardStates extends TurnStates { + + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public PowerCardStates(ClientState parent, ClientGameLogic logic) { super(parent, logic); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ShieldState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ShieldState.java index f7df51eb..3348e63c 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ShieldState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/ShieldState.java @@ -18,26 +18,48 @@ public class ShieldState extends PowerCardStates { private ArrayList possiblePieces; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public ShieldState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (PowerCardState) parent; possiblePieces = new ArrayList<>(); } + /** + * Enters the state. + */ @Override public void enter() { logic.addNotification(new SelectableShieldNotification(possiblePieces.stream().map(Piece::getUuid).toList())); } + /** + * Exits the state. + */ @Override public void exit() { possiblePieces = null; } + /** + * Sets the possible pieces. + * + * @param possiblePieces the possible pieces + */ public void setPossiblePieces(ArrayList possiblePieces) { this.possiblePieces = possiblePieces; } + /** + * Selects the piece. + * + * @param piece the piece + */ public void selectPiece(Piece piece) { if (possiblePieces.contains(piece)) { // logic.send(RequestPlayCardMessage.requestPlayShield(piece.getUuid())); @@ -49,7 +71,11 @@ public void selectPiece(Piece piece) { } } - + /** + * This method is called when the server sends a PlayCardMessage. + * + * @param msg the PlayCardMessage + */ @Override public void received(PlayCardMessage msg) { parent.getParent().getPlayPowerCard().setPlayCard(msg); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/SwapState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/SwapState.java index 6d6e40dc..d292c731 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/SwapState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/powercardstate/SwapState.java @@ -22,6 +22,12 @@ public class SwapState extends PowerCardStates { private Piece selectedOwnPiece; private Piece selectedEnemyPiece; + /** + * Constructs a client state of the specified game logic. + * + * @param parent the parent state + * @param logic the client game logic + */ public SwapState(ClientState parent, ClientGameLogic logic) { super(parent, logic); this.parent = (PowerCardState) parent; @@ -31,6 +37,9 @@ public SwapState(ClientState parent, ClientGameLogic logic) { selectedEnemyPiece = null; } + /** + * Enters the state. + */ @Override public void enter() { LOGGER.log(System.Logger.Level.INFO, "Entering SwapState"); @@ -41,6 +50,9 @@ public void enter() { selectedEnemyPiece = null; } + /** + * Exits the state. + */ @Override public void exit() { LOGGER.log(System.Logger.Level.INFO, "Exiting SwapState"); @@ -48,14 +60,29 @@ public void exit() { possibleEnemyPieces.clear(); } + /** + * Sets the possible own pieces. + * + * @param possibleOwnPieces the possible own pieces + */ public void setPossibleOwnPieces(ArrayList possibleOwnPieces) { this.possibleOwnPieces = possibleOwnPieces; } + /** + * Sets the possible enemy pieces. + * + * @param possibleEnemyPieces the possible enemy pieces + */ public void setPossibleEnemyPieces(ArrayList possibleEnemyPieces) { this.possibleEnemyPieces = possibleEnemyPieces; } + /** + * Selects the piece. + * + * @param piece the piece + */ @Override public void selectPiece(Piece piece) { if (possibleOwnPieces.contains(piece)) { @@ -74,6 +101,11 @@ public void selectPiece(Piece piece) { } } + /** + * Receive a card + * + * @param msg card message + */ @Override public void received(PlayCardMessage msg) { parent.getParent().getPlayPowerCard().setPlayCard(msg); From 42283f29a0041a1df336ca1fe30f2ee5a4ca9ea2 Mon Sep 17 00:00:00 2001 From: Hanno Fleischer Date: Wed, 11 Dec 2024 12:28:48 +0100 Subject: [PATCH 06/14] fixed missing passthrough statement in choosepiecestate --- .../client/gamestate/turnstate/ChoosePieceState.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java index bf6058e3..0eb6a2e1 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/ChoosePieceState.java @@ -109,6 +109,16 @@ public void received(EndOfTurnMessage msg) { currentState.received(msg); } + /** + * Receives the dice now message. + * + * @param msg the dice now message + */ + @Override + public void received(DiceNowMessage msg) { + currentState.received(msg); + } + /** * Receives the move message. * From 42a73ceb24e8bd2942130a9db803f5e1aa075ff0 Mon Sep 17 00:00:00 2001 From: Hanno Fleischer Date: Wed, 11 Dec 2024 13:03:39 +0100 Subject: [PATCH 07/14] after switching from spectator to animation you should now be reset correctly into spectator --- .../mdga/client/gamestate/AnimationState.java | 17 ++- .../mdga/client/gamestate/SpectatorState.java | 113 +++++++++++++----- 2 files changed, 100 insertions(+), 30 deletions(-) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java index 9f36617f..0f340d84 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/AnimationState.java @@ -11,6 +11,8 @@ public class AnimationState extends GameStates { private final GameState parent; + private boolean spectator = false; + /** * Constructs a client state of the specified game logic. * @@ -34,7 +36,16 @@ public void enter() { */ @Override public void exit() { + spectator = false; + } + /** + * Sets the spectator. + * + * @param spectator the spectator + */ + public void setSpectator(boolean spectator) { + this.spectator = spectator; } /** @@ -43,6 +54,10 @@ public void exit() { @Override public void selectAnimationEnd() { logic.send(new AnimationEndMessage()); - parent.setState(parent.getWaiting()); + if (spectator){ + parent.setState(parent.getSpectator()); + } else { + parent.setState(parent.getWaiting()); + } } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java index 9b123bc9..45f0622f 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/SpectatorState.java @@ -4,6 +4,7 @@ import pp.mdga.client.ClientState; import pp.mdga.client.GameState; import pp.mdga.game.BonusCard; +import pp.mdga.game.Node; import pp.mdga.game.Piece; import pp.mdga.game.PieceState; import pp.mdga.game.ShieldState; @@ -31,6 +32,7 @@ public SpectatorState(ClientState parent, ClientGameLogic logic) { */ @Override public void enter() { + parent.getAnimation().setSpectator(true); } /** @@ -42,7 +44,9 @@ public void exit() { } /** - * Receives the Ceremony Message. + * Handles the reception of a CeremonyMessage. + * + * @param msg the ceremony message */ @Override public void received(CeremonyMessage msg) { @@ -50,34 +54,30 @@ public void received(CeremonyMessage msg) { } /** - * Receives the Draw card message. + * Handles the reception of a DieMessage. * - * @param msg the draw card message - */ - @Override - public void received(DrawCardMessage msg) { - logic.getGame().getActivePlayer().addHandCard(msg.getCard()); - if (msg.getCard() instanceof HiddenCard) { - logic.addNotification(new DrawCardNotification(logic.getGame().getActiveColor(), BonusCard.HIDDEN)); - } - - //stats - logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getPlayerStatistic().increaseActivatedBonusNodes(); - logic.getGame().getGameStatistics().increaseActivatedBonusNodes(); - } - - /** - * Receives the Die Message. + * @param msg the die message */ @Override public void received(DieMessage msg) { logic.getGame().setDiceEyes(msg.getDiceEye()); - logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), logic.getGame().getDiceEyes(), logic.getGame().getDiceEyes() * logic.getGame().getDiceModifier())); - parent.setState(parent.getAnimation()); + if (logic.getGame().getTurboFlag()) { + logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), msg.getDiceEye(), logic.getGame().getDiceModifier())); + } else { + logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), msg.getDiceEye())); + } + + //stats + if (msg.getDiceEye() == 6) { + logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getPlayerStatistic().increaseDiced6(); + logic.getGame().getGameStatistics().increaseDiced6(); + } } /** - * Receives the PlayCardMessage Message. + * Handles the reception of a PlayCardMessage. + * + * @param msg the play card message */ @Override public void received(PlayCardMessage msg) { @@ -89,28 +89,73 @@ public void received(PlayCardMessage msg) { } /** - * Receives the ActivePlayerMessage Message. + * Handles the reception of an ActivePlayerMessage. + * + * @param msg the active player message */ @Override public void received(ActivePlayerMessage msg) { logic.addNotification(new ActivePlayerNotification(msg.getColor())); logic.getGame().setActiveColor(msg.getColor()); - parent.setState(parent.getAnimation()); + if (msg.getColor() == logic.getGame().getPlayers().get(logic.getOwnPlayerId()).getColor()) { + parent.setState(parent.getTurn()); + } else { + for (Piece piece : logic.getGame().getActivePlayer().getPieces()) { + if (piece.isShielded() || piece.isSuppressed()) { + logic.addNotification(new RemoveShieldNotification(piece.getUuid())); + piece.setShield(ShieldState.NONE); + } + } + } } /** - * Receives the MoveMessage Message. + * Handles the reception of a MoveMessage. + * + * @param msg the move message */ @Override public void received(MoveMessage msg) { Piece piece = logic.getGame().getPieceThroughUUID(msg.getPiece().getUuid()); if (msg.isHomeMove()) { - logic.addNotification(new HomeMoveNotification(piece.getUuid(), msg.getTargetIndex())); - logic.getGame().getBoard().getInfield()[logic.getGame().getBoard().getInfieldIndexOfPiece(piece)].clearOccupant(); - logic.getGame().getPlayerByColor(piece.getColor()).setPieceInHome(msg.getTargetIndex(), piece); + if (piece.getState().equals(PieceState.HOME)) { + logic.addNotification(new HomeMoveNotification(piece.getUuid(), msg.getTargetIndex())); + int pieceHomeIndex = logic.getGame().getActivePlayer().getHomeIndexOfPiece(piece); + Node pieceNode = logic.getGame().getActivePlayer().getHomeNodes()[pieceHomeIndex]; + + //gets the oldNode + int homeIndex = logic.getGame().getActivePlayer().getHomeIndexOfPiece(piece); + Node oldNode = logic.getGame().getActivePlayer().getHomeNodes()[homeIndex]; + //gets the targetNode + Node targetNode = logic.getGame().getActivePlayer().getHomeNodes()[msg.getTargetIndex()]; + if (msg.getTargetIndex() == logic.getGame().getActivePlayer().getHighestHomeIdx()) { + piece.setState(PieceState.HOMEFINISHED); + } else { + piece.setState(PieceState.HOME); + } + + oldNode.clearOccupant(); + targetNode.setOccupant(piece); + + } else { + logic.addNotification(new HomeMoveNotification(piece.getUuid(), msg.getTargetIndex())); + int oldNoteIdx = logic.getGame().getBoard().getInfieldIndexOfPiece(piece); + Node oldNode = logic.getGame().getBoard().getInfield()[oldNoteIdx]; + + //gets the targetNode + Node targetNode = logic.getGame().getActivePlayer().getHomeNodes()[msg.getTargetIndex()]; + + if (msg.getTargetIndex() == logic.getGame().getActivePlayer().getHighestHomeIdx()) { + piece.setState(PieceState.HOMEFINISHED); + } else { + piece.setState(PieceState.HOME); + } + + oldNode.clearOccupant(); + targetNode.setOccupant(piece); + } } else { int oldIndex = logic.getGame().getBoard().getInfieldIndexOfPiece(piece); - Piece occ = logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].getOccupant(); if (occ != null) { //TODO: MoveThrowNotification @@ -122,7 +167,7 @@ public void received(MoveMessage msg) { //set occ to waiting logic.getGame().getPlayerByColor(occ.getColor()).addWaitingPiece(occ); } - if (msg.getPiece().getState().equals(PieceState.WAITING)) { + if (oldIndex == -1) { logic.addNotification(new MovePieceNotification(piece.getUuid(), msg.getTargetIndex(), true)); logic.getGame().getPlayerByColor(piece.getColor()).removeWaitingPiece(piece); piece.setState(PieceState.ACTIVE); @@ -133,7 +178,17 @@ public void received(MoveMessage msg) { } //set new node logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].setOccupant(piece); + if (logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].isStart()) { + if (piece.isShielded()) { + piece.setShield(ShieldState.SUPPRESSED); + logic.addNotification(new ShieldSuppressedNotification(piece.getUuid())); + } + } else if (piece.isSuppressed()) { + piece.setShield(ShieldState.ACTIVE); + logic.addNotification(new ShieldActiveNotification(piece.getUuid())); + } } + System.out.println("send AnimationEndMessage"); logic.getGame().setTurboFlag(false); parent.setState(parent.getAnimation()); } From 07029407d81a7131e4af125a5fdb570eac02e846 Mon Sep 17 00:00:00 2001 From: Felix Koppe Date: Wed, 11 Dec 2024 13:11:48 +0100 Subject: [PATCH 08/14] Add ceremony --- .../main/java/pp/mdga/client/NotificationSynchronizer.java | 4 ++-- .../src/main/java/pp/mdga/client/view/CeremonyView.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java index 7fb06091..c4d366ee 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java @@ -133,8 +133,7 @@ private void handleGame(Notification notification) { app.getAcousticHandler().playSound(MdgaSound.UI90); delay = STANDARD_DELAY; } else if (notification instanceof CeremonyNotification ceremonyNotification) { - app.enter(MdgaState.CEREMONY); - CeremonyView ceremonyView = (CeremonyView) app.getView(); + CeremonyView ceremonyView = app.ceremonyView; int size = ceremonyNotification.getNames().size(); if (ceremonyNotification.getPiecesThrown().size() != size || @@ -162,6 +161,7 @@ private void handleGame(Notification notification) { ceremonyView.addStatisticsRow(name, v1, v2, v3, v4, v5, v6); } + app.enter(MdgaState.CEREMONY); } else if (notification instanceof DiceNowNotification) { guiHandler.hideText(); guiHandler.showDice(); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java index 794ac270..bdeee279 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java @@ -205,7 +205,7 @@ public void addCeremonyParticipant(Color color, int pos, String name) { ceremonyButtons.add(button); - if (state.equals(SubState.AWARD_CEREMONY)) { + if (state != null && state.equals(SubState.AWARD_CEREMONY)) { button.hide(); button.show(); } From ea25f66dae27bbd67d4add57480564639f9d9c76 Mon Sep 17 00:00:00 2001 From: Hanno Fleischer Date: Wed, 11 Dec 2024 13:34:38 +0100 Subject: [PATCH 09/14] wrote getter for ceremonyview in mdga app --- .../mdga/client/src/main/java/pp/mdga/client/MdgaApp.java | 6 +++++- .../main/java/pp/mdga/client/NotificationSynchronizer.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/MdgaApp.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/MdgaApp.java index 1487a306..1e1570c6 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/MdgaApp.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/MdgaApp.java @@ -88,7 +88,7 @@ public class MdgaApp extends SimpleApplication { private final TimerManager timerManager = new TimerManager(); - public static final int DEBUG_MULTIPLIER = 1; + public static final int DEBUG_MULTIPLIER = 0; public MdgaApp() { networkConnection = new NetworkSupport(this); @@ -351,5 +351,9 @@ public GameView getGameView() { public TimerManager getTimerManager() { return timerManager; } + + public CeremonyView getCeremonyView() { + return ceremonyView; + } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java index c4d366ee..8f4c7082 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java @@ -133,7 +133,7 @@ private void handleGame(Notification notification) { app.getAcousticHandler().playSound(MdgaSound.UI90); delay = STANDARD_DELAY; } else if (notification instanceof CeremonyNotification ceremonyNotification) { - CeremonyView ceremonyView = app.ceremonyView; + CeremonyView ceremonyView = app.getCeremonyView(); int size = ceremonyNotification.getNames().size(); if (ceremonyNotification.getPiecesThrown().size() != size || From 5854609b125d0442b22cfaa9d2bf23ed9e431986 Mon Sep 17 00:00:00 2001 From: Hanno Fleischer Date: Wed, 11 Dec 2024 13:43:15 +0100 Subject: [PATCH 10/14] added notification to change to startdialog state when calling next in statitics state --- .../main/java/pp/mdga/client/ceremonystate/StatisticsState.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java index 2d3bc943..f8cf6b64 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/ceremonystate/StatisticsState.java @@ -2,6 +2,7 @@ import pp.mdga.client.ClientGameLogic; import pp.mdga.client.ClientState; +import pp.mdga.notification.StartDialogNotification; public class StatisticsState extends CeremonyStates { @@ -36,6 +37,7 @@ public void exit() { */ @Override public void selectNext() { + logic.addNotification(new StartDialogNotification()); logic.setState(logic.getDialogs()); } } From 170a282077e44bf38bae36db261ed55d85f03561 Mon Sep 17 00:00:00 2001 From: Felix Koppe Date: Wed, 11 Dec 2024 13:56:55 +0100 Subject: [PATCH 11/14] Add selectNext --- .../src/main/java/pp/mdga/client/ModelSynchronizer.java | 4 ++++ .../src/main/java/pp/mdga/client/view/CeremonyView.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/ModelSynchronizer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/ModelSynchronizer.java index a700188f..9004efd1 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/ModelSynchronizer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/ModelSynchronizer.java @@ -144,6 +144,10 @@ public void enter(MdgaState state) { //app.enter(state); } + public void next() { + app.getGameLogic().selectNext(); + } + public void setSwap(boolean swap) { this.swap = swap; } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java index bdeee279..cec678d8 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/view/CeremonyView.java @@ -184,7 +184,7 @@ public void forward() { enterSub(SubState.STATISTICS); break; case STATISTICS: - app.getModelSynchronize().enter(MdgaState.MAIN); + app.getModelSynchronize().next(); break; } } From 8201ab4b6303ff283d367c8a1590d1e9d0017d6b Mon Sep 17 00:00:00 2001 From: Hanno Fleischer Date: Wed, 11 Dec 2024 14:11:07 +0100 Subject: [PATCH 12/14] added error handling when the drawpile is empty --- .../pp/mdga/server/automaton/LobbyState.java | 8 +++++++- .../game/turn/choosepiece/SelectPieceState.java | 17 +++++++++++++---- .../game/turn/choosepiece/StartPieceState.java | 17 +++++++++++++---- .../model/src/main/resources/mdga.properties | 1 + .../model/src/main/resources/mdga_de.properties | 1 + 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/LobbyState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/LobbyState.java index 4f4566e6..64746695 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/LobbyState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/LobbyState.java @@ -4,6 +4,7 @@ import pp.mdga.game.Piece; import pp.mdga.game.PieceState; import pp.mdga.game.Player; +import pp.mdga.game.card.PowerCard; import pp.mdga.message.client.*; import pp.mdga.message.server.*; import pp.mdga.server.ServerGameLogic; @@ -51,7 +52,12 @@ public void exit() { public void initializeGame() { for (var player : this.logic.getGame().getPlayers().values()) { player.initialize(); - player.addHandCard(this.logic.getGame().draw()); + PowerCard card = this.logic.getGame().draw(); + if (card == null) { + this.logic.getServerSender().broadcast(new IncorrectRequestMessage(7)); + } else { + player.addHandCard(card); + } Piece piece = player.getPieces()[0]; player.getWaitingArea()[0] = null; diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/SelectPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/SelectPieceState.java index 867323db..45645ad0 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/SelectPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/SelectPieceState.java @@ -5,6 +5,7 @@ import pp.mdga.game.card.PowerCard; import pp.mdga.message.client.RequestMoveMessage; import pp.mdga.message.server.DrawCardMessage; +import pp.mdga.message.server.IncorrectRequestMessage; import pp.mdga.message.server.MoveMessage; import pp.mdga.message.server.SelectPieceMessage; import pp.mdga.server.ServerGameLogic; @@ -137,13 +138,21 @@ public void received(RequestMoveMessage msg, int from) { if (targetNode.isBonus()) { logic.getGame().getActivePlayer().getPlayerStatistic().increaseActivatedBonusNodes(); logic.getGame().getGameStatistics().increaseActivatedBonusNodes(); + PowerCard cardToDraw = logic.getGame().draw(); for (Player p : logic.getGame().getPlayersAsList()) { if (p.getColor() == logic.getGame().getActiveColor()) { - PowerCard cardToDraw = logic.getGame().draw(); - p.addHandCard(cardToDraw); - logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(cardToDraw)); + if (cardToDraw == null) { + this.logic.getServerSender().broadcast(new IncorrectRequestMessage(7)); + } else { + p.addHandCard(cardToDraw); + logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(cardToDraw)); + } } else { - logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard())); + if (cardToDraw == null) { + this.logic.getServerSender().broadcast(new IncorrectRequestMessage(7)); + } else { + logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard())); + } } } } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/StartPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/StartPieceState.java index 96bedc62..22c5c794 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/StartPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/StartPieceState.java @@ -7,6 +7,7 @@ import pp.mdga.game.card.PowerCard; import pp.mdga.message.client.RequestMoveMessage; import pp.mdga.message.server.DrawCardMessage; +import pp.mdga.message.server.IncorrectRequestMessage; import pp.mdga.message.server.MoveMessage; import pp.mdga.message.server.StartPieceMessage; import pp.mdga.server.ServerGameLogic; @@ -70,13 +71,21 @@ public void received(RequestMoveMessage msg, int from) { if (targetNode.isBonus()) { logic.getGame().getActivePlayer().getPlayerStatistic().increaseActivatedBonusNodes(); logic.getGame().getGameStatistics().increaseActivatedBonusNodes(); + PowerCard cardToDraw = logic.getGame().draw(); for (Player p : logic.getGame().getPlayersAsList()) { if (p.getColor() == logic.getGame().getActiveColor()) { - PowerCard cardToDraw = logic.getGame().draw(); - p.addHandCard(cardToDraw); - logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(cardToDraw)); + if (cardToDraw == null) { + this.logic.getServerSender().broadcast(new IncorrectRequestMessage(7)); + } else { + p.addHandCard(cardToDraw); + logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(cardToDraw)); + } } else { - logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard())); + if (cardToDraw == null) { + this.logic.getServerSender().broadcast(new IncorrectRequestMessage(7)); + } else { + logic.getServerSender().send(logic.getGame().getPlayerIdByColor(p.getColor()), new DrawCardMessage(new HiddenCard())); + } } } } diff --git a/Projekte/mdga/model/src/main/resources/mdga.properties b/Projekte/mdga/model/src/main/resources/mdga.properties index bb0c2ca9..cebda5c9 100644 --- a/Projekte/mdga/model/src/main/resources/mdga.properties +++ b/Projekte/mdga/model/src/main/resources/mdga.properties @@ -7,6 +7,7 @@ incorrect.request.3=Selected to many or wrong pieces. incorrect.request.4=Did not select exactly 2 pieces or selected wrong pieces. incorrect.request.5=Cannot start game because not everyone is ready. incorrect.request.6=You are alone in this Lobby. +incorrect.request.7=The draw pile is empty. diff --git a/Projekte/mdga/model/src/main/resources/mdga_de.properties b/Projekte/mdga/model/src/main/resources/mdga_de.properties index 0f8855f5..4a1e521f 100644 --- a/Projekte/mdga/model/src/main/resources/mdga_de.properties +++ b/Projekte/mdga/model/src/main/resources/mdga_de.properties @@ -7,3 +7,4 @@ incorrect.request.3=Du hast zuviele, oder eine falsche Figur ausgew incorrect.request.4=Du hast nicht genau zwei Figuren, oder falsche Figuren ausgewählt. incorrect.request.5=Du kannst das Spiel nicht starten, da nicht alle Spieler bereit sind. incorrect.request.6=Du bist alleine in dieser Lobby. +incorrect.request.7=Der Nachziehstapel ist leer. From b8df688ba3019a66549162284e55d14d9528a80a Mon Sep 17 00:00:00 2001 From: Cedric Beck Date: Wed, 11 Dec 2024 14:23:24 +0100 Subject: [PATCH 13/14] added highlight/hover/select to nodes --- .../pp/mdga/client/InputSynchronizer.java | 26 ++- .../pp/mdga/client/board/BoardHandler.java | 103 +++++------ .../pp/mdga/client/board/NodeControl.java | 44 +---- .../pp/mdga/client/board/OutlineControl.java | 160 ++++++++++++++---- .../mdga/client/board/OutlineOEControl.java | 40 +++++ .../pp/mdga/client/board/PieceControl.java | 114 +------------ .../java/pp/mdga/client/gui/CardControl.java | 77 +-------- .../pp/mdga/client/gui/CardLayerHandler.java | 15 +- .../client/outline/SelectObjectOutliner.java | 16 +- 9 files changed, 252 insertions(+), 343 deletions(-) create mode 100644 Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineOEControl.java diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/InputSynchronizer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/InputSynchronizer.java index 39875eb0..2978753c 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/InputSynchronizer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/InputSynchronizer.java @@ -14,6 +14,7 @@ import com.jme3.scene.control.AbstractControl; import pp.mdga.client.board.NodeControl; import pp.mdga.client.board.OutlineControl; +import pp.mdga.client.board.OutlineOEControl; import pp.mdga.client.board.PieceControl; import pp.mdga.client.gui.CardControl; import pp.mdga.client.gui.DiceControl; @@ -32,7 +33,7 @@ public class InputSynchronizer { private float rotationAngle = 180f; private int scrollValue = 0; private CardControl hoverCard; - private PieceControl hoverPiece; + private OutlineOEControl hoverPiece; private boolean clickAllowed = true; @@ -113,7 +114,7 @@ public void onAction(String name, boolean isPressed, float tpf) { if (app.getView() instanceof GameView gameView) { DiceControl diceSelect = checkHover(gameView.getGuiHandler().getCardLayerCamera(), gameView.getGuiHandler().getCardLayerRootNode(), DiceControl.class); CardControl cardLayerSelect = checkHover(gameView.getGuiHandler().getCardLayerCamera(), gameView.getGuiHandler().getCardLayerRootNode(), CardControl.class); - OutlineControl boardSelect = checkHover(app.getCamera(), app.getRootNode(), OutlineControl.class); + OutlineOEControl boardSelect = checkHover(app.getCamera(), app.getRootNode(), OutlineOEControl.class); if (diceSelect != null) { app.getModelSynchronize().rolledDice(); @@ -122,12 +123,7 @@ public void onAction(String name, boolean isPressed, float tpf) { if (cardLayerSelect.isSelectable()) gameView.getGuiHandler().selectCard(cardLayerSelect); } else if (boardSelect != null) { //boardSelect - if (boardSelect instanceof PieceControl pieceControl) { - if (pieceControl.isSelectable()) gameView.getBoardHandler().pieceSelect(pieceControl); - } - if (boardSelect instanceof NodeControl nodeControl) { -// - } + gameView.getBoardHandler().pieceSelect(boardSelect); } else { //both null } @@ -235,13 +231,12 @@ private T checkHoverOrtho(Camera cam, Node root, Cla */ private void hoverPiece() { if (app.getView() instanceof GameView gameView) { - PieceControl control = checkPiece(); + OutlineOEControl control = checkPiece(); if (control != null) { if (control != hoverPiece) { pieceOff(gameView); hoverPiece = control; -// hoverPiece.hover(); - gameView.getBoardHandler().pieceHoverOn(hoverPiece); + if(hoverPiece.isHoverable()) gameView.getBoardHandler().hoverOn(hoverPiece); } } else { pieceOff(gameView); @@ -260,7 +255,7 @@ private void hoverCard() { if (control != hoverCard) { cardOff(); hoverCard = control; - hoverCard.hover(); + hoverCard.hoverOn(); } } else { cardOff(); @@ -273,8 +268,8 @@ private void hoverCard() { * * @return The PieceControl of the hovered piece, or null if no piece is hovered. */ - private PieceControl checkPiece() { - return checkHover(app.getCamera(), app.getRootNode(), PieceControl.class); + private OutlineOEControl checkPiece() { + return checkHover(app.getCamera(), app.getRootNode(), OutlineOEControl.class); } /** @@ -296,8 +291,7 @@ private CardControl checkCard(GameView gameView) { */ private void pieceOff(GameView gameView) { if (hoverPiece != null) { - gameView.getBoardHandler().pieceHoverOff(hoverPiece); -// hoverPiece.hoverOff(); + if(hoverPiece.isHoverable()) gameView.getBoardHandler().hoverOff(hoverPiece); } hoverPiece = null; } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java index a0ae295d..027b488c 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/BoardHandler.java @@ -15,6 +15,7 @@ import pp.mdga.client.animation.*; import pp.mdga.client.gui.DiceControl; import pp.mdga.game.Color; +import pp.mdga.game.Piece; import java.util.*; @@ -603,10 +604,8 @@ public void outlineMove(List pieces, List moveIndexe, List ownPieces, List enemyPieces) { for (UUID uuid : ownPieces) { PieceControl p = pieces.get(uuid); - p.highlight(false); - p.setHoverable(true); - p.setSelectable(true); + p.selectableOwn(); selectableOwnPieces.add(p); } for (UUID uuid : enemyPieces) { PieceControl p = pieces.get(uuid); - p.highlight(true); - p.setHoverable(true); - p.setSelectable(true); + p.selectableOff(); selectableEnemyPieces.add(p); } } @@ -655,9 +650,7 @@ public void outlineShield(List pieces) { for (UUID uuid : pieces) { PieceControl p = this.pieces.get(uuid); - p.highlight(false); - p.setHoverable(true); - p.setSelectable(true); + p.selectableOwn(); selectableOwnPieces.add(p); } } @@ -667,31 +660,35 @@ public void outlineShield(List pieces) { * * @param pieceSelected the PieceControl instance representing the piece selected by the user */ - public void pieceSelect(PieceControl pieceSelected) { - boolean isSelected = pieceSelected.isSelected(); - if (selectableOwnPieces.contains(pieceSelected)) { + public void pieceSelect(OutlineOEControl selected) { + PieceControl piece = getPieceByOE(selected); + NodeControl node = selectedPieceNodeMap.get(piece); + + boolean isSelected = piece.isSelected(); + if (selectableOwnPieces.contains(piece)) { for (PieceControl p : selectableOwnPieces) { - p.unSelect(); - if (selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unSelect(); + p.selectOff(); + NodeControl n = selectedPieceNodeMap.get(p); + if (n != null) n.selectOff(); } if (!isSelected) { - pieceSelected.select(); - if (selectedPieceNodeMap.get(pieceSelected) != null) selectedPieceNodeMap.get(pieceSelected).select(); - selectedOwnPiece = pieceSelected; + piece.selectOn(); + if (node != null) node.selectOn(); + selectedOwnPiece = piece; } else { - pieceSelected.unSelect(); - if (selectedPieceNodeMap.get(pieceSelected) != null) selectedPieceNodeMap.get(pieceSelected).unSelect(); + piece.selectOff(); + if (node != null) node.selectOff();; selectedOwnPiece = null; } - } else if (selectableEnemyPieces.contains(pieceSelected)) { + } else if (selectableEnemyPieces.contains(piece)) { for (PieceControl p : selectableEnemyPieces) { - p.unSelect(); + p.selectOff(); } if (!isSelected) { - pieceSelected.select(); - selectedEnemyPiece = pieceSelected; + piece.selectOn(); + selectedEnemyPiece = piece; } else { - pieceSelected.unSelect(); + piece.selectOff(); selectedEnemyPiece = null; } } else throw new RuntimeException("pieceSelected is not in own/enemySelectablePieces"); @@ -699,37 +696,47 @@ public void pieceSelect(PieceControl pieceSelected) { app.getModelSynchronize().select(getKeyByValue(pieces, selectedOwnPiece), getKeyByValue(pieces, selectedEnemyPiece)); } - public void pieceHoverOn(PieceControl hoverPiece) { - hoverPiece.hover(); - if (selectedPieceNodeMap.get(hoverPiece) != null) selectedPieceNodeMap.get(hoverPiece).hover(); + public void hoverOn(OutlineOEControl hover) { + PieceControl piece = getPieceByOE(hover); + NodeControl node = selectedPieceNodeMap.get(piece); + + piece.hoverOn(); + if(node != null) node.hoverOn(); } - public void pieceHoverOff(PieceControl hoverPiece) { - hoverPiece.hoverOff(); - if (selectedPieceNodeMap.get(hoverPiece) != null) selectedPieceNodeMap.get(hoverPiece).hoverOff(); + public void hoverOff(OutlineOEControl hover) { + PieceControl piece = getPieceByOE(hover); + NodeControl node = selectedPieceNodeMap.get(piece); + + piece.hoverOff(); + if(node != null) node.hoverOff(); + } + + private PieceControl getPieceByOE(OutlineOEControl control){ + PieceControl piece; + if (control instanceof PieceControl p){ + piece = p; + } + else if (control instanceof NodeControl n){ + piece = getKeyByValue(selectedPieceNodeMap, n); + } + else throw new RuntimeException("selected is not instanceof piece or node"); + return piece; } /** * Clears all highlighted, selectable, and selected pieces and nodes. */ public void clearSelectable() { - for (PieceControl p : selectableEnemyPieces) { - p.unSelect(); - p.unHighlight(); - p.setSelectable(false); - p.setHoverable(false); - } for (PieceControl p : selectableOwnPieces) { - p.unSelect(); - p.unHighlight(); - p.setSelectable(false); - p.setHoverable(false); - if (selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unSelect(); - if (selectedPieceNodeMap.get(p) != null) selectedPieceNodeMap.get(p).unHighlight(); + p.selectableOff(); + NodeControl n = selectedPieceNodeMap.get(p); + if(n != null) n.selectableOff(); } - for (NodeControl n : outlineNodes) { - n.deOutline(); + for (PieceControl p : selectableEnemyPieces) { + p.selectableOff(); } + outlineNodes.clear(); selectableEnemyPieces.clear(); selectableOwnPieces.clear(); diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/NodeControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/NodeControl.java index 5eb363a8..c710d776 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/NodeControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/NodeControl.java @@ -9,16 +9,7 @@ * A control that adds highlighting functionality to a node in the game. * This class extends {@link OutlineControl} to add an outline effect when the node is highlighted. */ -public class NodeControl extends OutlineControl { - - private static final ColorRGBA OUTLINE_HIGHLIGHT_COLOR = ColorRGBA.White; - private static final int OUTLINE_HIGHLIGHT_WIDTH = 6; - private static final ColorRGBA OUTLINE_SELECT_COLOR = ColorRGBA.Cyan; - private static final int OUTLINE_SELECT_WIDTH = 8; - private static final ColorRGBA OUTLINE_HOVER_COLOR = ColorRGBA.Yellow; - private static final int OUTLINE_HOVER_WIDTH = 6; - private boolean select = false; - private boolean highlight = false; +public class NodeControl extends OutlineOEControl { /** * Constructs a {@link NodeControl} with the specified application and post processor. @@ -28,7 +19,7 @@ public class NodeControl extends OutlineControl { * @param fpp The {@link FilterPostProcessor} to apply post-processing effects. */ public NodeControl(MdgaApp app, FilterPostProcessor fpp) { - super(app, fpp); + super(app, fpp, app.getCamera()); } /** @@ -40,35 +31,4 @@ public NodeControl(MdgaApp app, FilterPostProcessor fpp) { public Vector3f getLocation() { return this.getSpatial().getLocalTranslation(); } - - public void highlight() { - highlight = true; - super.outline(OUTLINE_HIGHLIGHT_COLOR, OUTLINE_HIGHLIGHT_WIDTH); - } - - public void unHighlight() { - highlight = false; - deOutline(); - } - - public void select() { - select = true; - super.outline(OUTLINE_SELECT_COLOR, OUTLINE_SELECT_WIDTH); - } - - public void unSelect() { - select = false; - if (highlight) highlight(); - else deOutline(); - } - - public void hover() { - super.outline(OUTLINE_HOVER_COLOR, OUTLINE_HOVER_WIDTH); - } - - public void hoverOff() { - if (select) select(); - else if (highlight) highlight(); - else deOutline(); - } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineControl.java index 1ff12334..b2a210c4 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineControl.java @@ -16,9 +16,18 @@ public class OutlineControl extends InitControl { /** * The {@link SelectObjectOutliner} responsible for managing the outline effect. */ - private final SelectObjectOutliner outlineOwn; - private static final int THICKNESS_DEFAULT = 6; - private MdgaApp app; + private final SelectObjectOutliner selectObjectOutliner; + private final MdgaApp app; + private boolean hoverable = false; + private boolean highlight = false; + private boolean selectable = false; + private boolean select = false; + private ColorRGBA highlightColor; + private int highlightWidth; + private ColorRGBA hoverColor; + private int hoverWidth; + private ColorRGBA selectColor; + private int selectWidth; /** * Constructs an {@code OutlineControl} with default thickness for the object outline. @@ -26,44 +35,30 @@ public class OutlineControl extends InitControl { * @param app The main application managing the outline control. * @param fpp The {@code FilterPostProcessor} used for post-processing effects. */ - public OutlineControl(MdgaApp app, FilterPostProcessor fpp) { + public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, + ColorRGBA highlightColor, int highlightWidth, + ColorRGBA hoverColor, int hoverWidth, + ColorRGBA selectColor, int selectWidth + ) { this.app = app; - outlineOwn = new SelectObjectOutliner(THICKNESS_DEFAULT, fpp, app.getRenderManager(), app.getAssetManager(), app.getCamera(), app); + this.highlightColor = highlightColor; + this.highlightWidth = highlightWidth; + this.hoverColor = hoverColor; + this.hoverWidth = hoverWidth; + this.selectColor = selectColor; + this.selectWidth = selectWidth; + selectObjectOutliner = new SelectObjectOutliner(fpp, app.getRenderManager(), app.getAssetManager(), cam, app); } - /** - * Constructs an {@code OutlineControl} with default thickness, allowing a custom camera to be specified. - * - * @param app The main application managing the outline control. - * @param fpp The {@code FilterPostProcessor} used for post-processing effects. - * @param cam The camera used for rendering the outlined objects. - */ - public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam) { - this.app = app; - outlineOwn = new SelectObjectOutliner(THICKNESS_DEFAULT, fpp, app.getRenderManager(), app.getAssetManager(), cam, app); - } - - /** - * Constructs an {@code OutlineControl} with a specified thickness and custom camera. - * - * @param app The main application managing the outline control. - * @param fpp The {@code FilterPostProcessor} used for post-processing effects. - * @param cam The camera used for rendering the outlined objects. - * @param thickness The thickness of the outline. - */ - public OutlineControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, int thickness) { - this.app = app; - outlineOwn = new SelectObjectOutliner(thickness, fpp, app.getRenderManager(), app.getAssetManager(), cam, app); - } /** * Applies an outline to the spatial object with the given color. * * @param color The {@link ColorRGBA} representing the color of the outline. */ - public void outline(ColorRGBA color) { - outlineOwn.select(spatial, color); - } +// public void outline(ColorRGBA color) { +// selectObjectOutliner.select(spatial, color); +// } /** * Applies an outline to the spatial object with the given color and width. @@ -72,15 +67,15 @@ public void outline(ColorRGBA color) { * @param width The width of the outline. */ public void outline(ColorRGBA color, int width) { - deOutline(); - outlineOwn.select(spatial, color, width); + outlineOff(); + selectObjectOutliner.select(spatial, color, width); } /** * Removes the outline effect from the spatial object. */ - public void deOutline() { - outlineOwn.deselect(spatial); + public void outlineOff() { + selectObjectOutliner.deselect(spatial); } /** @@ -91,4 +86,97 @@ public void deOutline() { public MdgaApp getApp() { return app; } + + public void highlightOn() { + highlight = true; + outline(highlightColor, highlightWidth); + } + + public void highlightOff() { + highlight = false; + outlineOff(); + } + + public void hoverOn() { + if (!hoverable) return; + outline(hoverColor, hoverWidth); + } + + public void hoverOff() { + if (!hoverable) return; + + if (select) selectOn(); + else if (highlight) highlightOn(); + else outlineOff(); + } + + public void selectOn() { + if (!selectable) return; + select = true; + outline(selectColor, selectWidth); + } + + public void selectOff() { + select = false; + if (highlight) highlightOn(); + else outlineOff(); + } + + public void selectableOn(){ + setSelectable(true); + setHoverable(true); + highlightOn(); + select = false; + } + + public void selectableOff(){ + setSelectable(false); + setHoverable(false); + highlightOff(); + select = false; + } + + private void setSelectable(boolean selectable) { + this.selectable = selectable; + } + + public boolean isSelected() { + return select; + } + + public boolean isSelectable() { + return selectable; + } + + public boolean isHoverable() { + return hoverable; + } + + private void setHoverable(boolean hoverable) { + this.hoverable = hoverable; + } + + public void setHighlightColor(ColorRGBA color){ + highlightColor = color; + } + + public void setHighlightWidth(int width){ + highlightWidth = width; + } + + public void setHoverColor(ColorRGBA color){ + hoverColor = color; + } + + public void setHoverWidth(int width){ + hoverWidth = width; + } + + public void setSelectColor(ColorRGBA color){ + selectColor = color; + } + + public void setSelectWidth(int width){ + selectWidth = width; + } } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineOEControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineOEControl.java new file mode 100644 index 00000000..6a7c8e56 --- /dev/null +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/OutlineOEControl.java @@ -0,0 +1,40 @@ +package pp.mdga.client.board; + +import com.jme3.math.ColorRGBA; +import com.jme3.post.FilterPostProcessor; +import com.jme3.renderer.Camera; +import pp.mdga.client.MdgaApp; + +public class OutlineOEControl extends OutlineControl{ + private static final ColorRGBA OUTLINE_OWN_COLOR = ColorRGBA.White; + private static final ColorRGBA OUTLINE_ENEMY_COLOR = ColorRGBA.Red; + private static final ColorRGBA OUTLINE_OWN_HOVER_COLOR = ColorRGBA.Yellow; + private static final ColorRGBA OUTLINE_ENEMY_HOVER_COLOR = ColorRGBA.Green; + private static final ColorRGBA OUTLINE_OWN_SELECT_COLOR = ColorRGBA.Cyan; + private static final ColorRGBA OUTLINE_ENEMY_SELECT_COLOR = ColorRGBA.Orange; + private static final int OUTLINE_HIGHLIGHT_WIDTH = 8; + private static final int OUTLINE_HOVER_WIDTH = 8; + private static final int OUTLINE_SELECT_WIDTH = 10; + + public OutlineOEControl(MdgaApp app, FilterPostProcessor fpp, Camera cam){ + super(app, fpp, cam, + OUTLINE_OWN_COLOR, OUTLINE_HIGHLIGHT_WIDTH, + OUTLINE_OWN_HOVER_COLOR, OUTLINE_HOVER_WIDTH, + OUTLINE_OWN_SELECT_COLOR, OUTLINE_SELECT_WIDTH + ); + } + + public void selectableOwn(){ + setHighlightColor(OUTLINE_OWN_COLOR); + setHoverColor(OUTLINE_OWN_HOVER_COLOR); + setSelectColor(OUTLINE_OWN_SELECT_COLOR); + selectableOn(); + } + + public void selectableEnemy(){ + setHighlightColor(OUTLINE_ENEMY_COLOR); + setHoverColor(OUTLINE_ENEMY_HOVER_COLOR); + setSelectColor(OUTLINE_ENEMY_SELECT_COLOR); + selectableOn(); + } +} diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/PieceControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/PieceControl.java index 9342e668..1ba43cf6 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/board/PieceControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/board/PieceControl.java @@ -20,7 +20,7 @@ * to provide outline functionality and includes additional features like shield effects, * hover states, and selection states. */ -public class PieceControl extends OutlineControl { +public class PieceControl extends OutlineOEControl { private final float initRotation; private final AssetManager assetManager; private Spatial shieldRing; @@ -32,16 +32,6 @@ public class PieceControl extends OutlineControl { private static final ColorRGBA SHIELD_SUPPRESSED_COLOR = new ColorRGBA(1f, 0.5f, 0, SHIELD_TRANSPARENCY); private static final float SHIELD_Z = 0f; - private static final ColorRGBA OUTLINE_OWN_COLOR = ColorRGBA.White; - private static final ColorRGBA OUTLINE_ENEMY_COLOR = ColorRGBA.Red; - private static final ColorRGBA OUTLINE_OWN_HOVER_COLOR = ColorRGBA.Yellow; - private static final ColorRGBA OUTLINE_ENEMY_HOVER_COLOR = ColorRGBA.Green; - private static final ColorRGBA OUTLINE_OWN_SELECT_COLOR = ColorRGBA.Cyan; - private static final ColorRGBA OUTLINE_ENEMY_SELECT_COLOR = ColorRGBA.Orange; - private static final int OUTLINE_HIGHLIGHT_WIDTH = 8; - private static final int OUTLINE_HOVER_WIDTH = 8; - private static final int OUTLINE_SELECT_WIDTH = 10; - private final Node parentNode; private boolean enemy; private boolean hoverable; @@ -59,18 +49,13 @@ public class PieceControl extends OutlineControl { * @param fpp The {@link FilterPostProcessor} to apply post-processing effects. */ public PieceControl(float initRotation, AssetManager assetManager, MdgaApp app, FilterPostProcessor fpp) { - super(app, fpp); + super(app, fpp, app.getCamera()); this.parentNode = new Node(); this.initRotation = initRotation; this.assetManager = assetManager; this.shieldRing = null; this.shieldMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); this.shieldMat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha); - enemy = false; - hoverable = false; - highlight = false; - selectable = false; - select = false; } /** @@ -190,99 +175,4 @@ public void setMaterial(Material mat) { public Material getMaterial() { return ((Geometry) getSpatial()).getMaterial(); } - - /** - * Highlights the piece with the appropriate outline color based on whether it is an enemy or not. - * - * @param enemy True if the piece is an enemy, false if it is owned by the player. - */ - public void highlight(boolean enemy) { - this.enemy = enemy; - highlight = true; - super.outline(enemy ? OUTLINE_ENEMY_COLOR : OUTLINE_OWN_COLOR, OUTLINE_HIGHLIGHT_WIDTH); - } - - /** - * Removes the highlight effect from the piece. - */ - public void unHighlight() { - highlight = false; - deOutline(); - } - - /** - * Applies a hover effect on the piece if it is hoverable. - */ - public void hover() { - if (!hoverable) return; - super.outline(enemy ? OUTLINE_ENEMY_HOVER_COLOR : OUTLINE_OWN_HOVER_COLOR, OUTLINE_HOVER_WIDTH); - } - - /** - * Removes the hover effect from the piece. - */ - public void hoverOff() { - if (!hoverable) return; - - if (select) select(); - else if (highlight) highlight(enemy); - else deOutline(); - } - - /** - * Deselects the piece and removes the selection outline. If the piece was highlighted, - * it will be re-highlighted. Otherwise, the outline is removed. - */ - public void unSelect() { - select = false; - if (highlight) highlight(enemy); - else deOutline(); - } - - /** - * Selects the piece and applies the selection outline. If the piece is an enemy, it will - * be outlined with the enemy selection color; otherwise, the own selection color will be used. - */ - public void select() { - if (!selectable) return; - select = true; - super.outline(enemy ? OUTLINE_ENEMY_SELECT_COLOR : OUTLINE_OWN_SELECT_COLOR, OUTLINE_SELECT_WIDTH); - } - - /** - * Sets whether the piece is selectable. - * - * @param selectable True if the piece can be selected, false otherwise. - */ - public void setSelectable(boolean selectable) { - this.selectable = selectable; - } - - /** - * Checks if the piece is selected. - * - * @return True if the piece is selected, false otherwise. - */ - public boolean isSelected() { - return select; - } - - /** - * Checks if the piece is selectable. - * - * @return True if the piece is selectable, false otherwise. - */ - public boolean isSelectable() { - return selectable; - } - - /** - * Sets whether the piece is hoverable. - * - * @param hoverable True if the piece can be hovered over, false otherwise. - */ - public void setHoverable(boolean hoverable) { - this.hoverable = hoverable; - } - } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardControl.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardControl.java index ab9d3647..6a86cc13 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardControl.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardControl.java @@ -15,8 +15,6 @@ public class CardControl extends OutlineControl { - private static final ColorRGBA OUTLINE_COLOR = ColorRGBA.Yellow; - private static final ColorRGBA HIGHLIGHT_COLOR = ColorRGBA.Yellow; private static final int HIGHLIGHT_WIDTH = 9; @@ -27,16 +25,16 @@ public class CardControl extends OutlineControl { private static final int SELECT_WIDTH = 13; - private static final int OUTLINE_THICKNESS = 9; - private boolean hoverable; - private boolean highlight; - private boolean selectable; - private boolean select; private Node root; private BitmapText num; public CardControl(MdgaApp app, FilterPostProcessor fpp, Camera cam, Node root) { - super(app, fpp, cam, OUTLINE_THICKNESS); + super(app, fpp, cam, + HIGHLIGHT_COLOR, HIGHLIGHT_WIDTH, + HOVER_COLOR, HOVER_WIDTH, + SELECT_COLOR, SELECT_WIDTH + ); + this.root = root; @@ -77,67 +75,6 @@ public Node getRoot() { public void initSpatial() { } - public void outline() { - super.outline(OUTLINE_COLOR); - } - private final static Vector3f HIGHLIGHT_Y = new Vector3f(0, 0.4f, 0); - - public void setHighlight() { - this.highlight = true; - root.setLocalTranslation(root.getLocalTranslation().add(HIGHLIGHT_Y)); - highlight(); - } - - public void highlight() { - super.outline(HIGHLIGHT_COLOR, HIGHLIGHT_WIDTH); - } - - public void unHighlight() { - highlight = false; - root.setLocalTranslation(root.getLocalTranslation().subtract(HIGHLIGHT_Y)); - deOutline(); - } - - public void hover() { - if (!hoverable) return; - super.outline(HOVER_COLOR, HOVER_WIDTH); - } - - public void hoverOff() { - if (!hoverable) return; - - if (select) select(); - else if (highlight) highlight(); - else deOutline(); - } - - public void select() { - if (!selectable) return; - select = true; - super.outline(SELECT_COLOR, SELECT_WIDTH); - } - - public void unSelect() { - if (!selectable) return; - select = false; - if (highlight) highlight(); - else deOutline(); - } - - public void setSelectable(boolean selectable) { - this.selectable = selectable; - } - - public boolean isSelected() { - return select; - } - - public boolean isSelectable() { - return selectable; - } - - public void setHoverable(boolean hoverable) { - this.hoverable = hoverable; - } } + diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayerHandler.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayerHandler.java index 08c73781..832ed2d7 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayerHandler.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/gui/CardLayerHandler.java @@ -104,10 +104,7 @@ public void removeCard(BonusCard card) { public void clearSelectableCards() { for (CardControl control : selectableCards) { - control.setSelectable(false); - control.setHoverable(false); - control.unHighlight(); - control.unSelect(); + control.selectableOff(); } selectableCards.clear(); cardSelect = null; @@ -134,21 +131,19 @@ public void setSelectableCards(List select) { selectableCards.add(bonusCardControlMap.get(card)); } for (CardControl control : selectableCards) { - control.setSelectable(true); - control.setHoverable(true); - control.setHighlight(); + control.selectableOn(); } } public void selectCard(CardControl cardControl) { if (cardControl.isSelected()) { - cardControl.unSelect(); + cardControl.selectOff(); cardSelect = null; } else { for (CardControl control : selectableCards) { - control.unSelect(); + control.selectOff(); } - cardControl.select(); + cardControl.selectOn(); cardSelect = getKeyByValue(bonusCardControlMap, cardControl); } diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/SelectObjectOutliner.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/SelectObjectOutliner.java index 9609fb89..f3da2c08 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/SelectObjectOutliner.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/outline/SelectObjectOutliner.java @@ -15,20 +15,18 @@ public class SelectObjectOutliner { private final RenderManager renderManager; private final AssetManager assetManager; private final Camera cam; - private final int width; private boolean selected; private ViewPort outlineViewport = null; // private OutlineFilter outlineFilter = null; private OutlineProFilter outlineFilter = null; private final MdgaApp app; - public SelectObjectOutliner(int width, FilterPostProcessor fpp, RenderManager renderManager, AssetManager assetManager, Camera cam, MdgaApp app) { + public SelectObjectOutliner(FilterPostProcessor fpp, RenderManager renderManager, AssetManager assetManager, Camera cam, MdgaApp app) { this.selected = false; this.fpp = fpp; this.renderManager = renderManager; this.assetManager = assetManager; this.cam = cam; - this.width = width; this.app = app; } @@ -39,12 +37,12 @@ public void deselect(Spatial model) { } } - public void select(Spatial model, ColorRGBA color) { - if (!selected) { - selected = true; - showOutlineFilterEffect(model, width, color); - } - } +// public void select(Spatial model, ColorRGBA color) { +// if (!selected) { +// selected = true; +// showOutlineFilterEffect(model, width, color); +// } +// } public void select(Spatial model, ColorRGBA color, int width) { if (!selected) { From 4b665c4cf281adeda829fa8939b2e65a65f2cbea Mon Sep 17 00:00:00 2001 From: Hanno Fleischer Date: Wed, 11 Dec 2024 16:49:45 +0100 Subject: [PATCH 14/14] getter and setter fo isDied --- .../game/turn/rolldice/FirstRollState.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/FirstRollState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/FirstRollState.java index c7ee4a36..448421b6 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/FirstRollState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/rolldice/FirstRollState.java @@ -87,4 +87,22 @@ public void received(AnimationEndMessage msg, int from) { } } } + + /** + * This method is used to get the isDied boolean. + * + * @return the isDied boolean. + */ + public boolean isDied() { + return isDied; + } + + /** + * This method is used to set the isDied boolean. + * + * @param isDied as a boolean. + */ + public void setIsDied(boolean isDied) { + this.isDied = isDied; + } }