From f1d52c445b6f8b05c8b335f96c733992596e20d8 Mon Sep 17 00:00:00 2001 From: Filip Szepielewicz Date: Fri, 22 Nov 2024 21:45:22 +0100 Subject: [PATCH] =?UTF-8?q?Tests=20bis=20T075=20=C3=BCberarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/pp/battleship/client/Menu.java | 13 +- .../pp/battleship/exporter/ModelExporter.java | 7 +- .../Interface/Lemur/pp-styles.groovy | 82 +- Projekte/monopoly/client/build.gradle | 1 + .../java/pp/monopoly/client/GameSound.java | 39 +- .../main/java/pp/monopoly/client/Menu.java | 10 +- .../java/pp/monopoly/client/MonopolyApp.java | 486 ++----- .../pp/monopoly/client/MonopolyAppConfig.java | 10 +- .../pp/monopoly/client/MonopolyAppState.java | 40 +- .../pp/monopoly/client/NetworkDialog.java | 121 +- .../pp/monopoly/client/NetworkSupport.java | 64 +- .../java/pp/monopoly/client/StartMenu.java | 216 ++- .../client/gui/BoardSynchronizer.java | 51 +- .../java/pp/monopoly/client/gui/GameMenu.java | 1 + .../java/pp/monopoly/client/gui/MapView.java | 148 +- .../client/gui/MapViewSynchronizer.java | 62 +- .../main/resources/Pictures/logo-unibw.png | Bin 45063 -> 495563 bytes Projekte/monopoly/model/build.gradle | 7 +- .../main/java/pp/monopoly/MonopolyConfig.java | 9 +- .../monopoly/game/client/ClientGameLogic.java | 97 +- .../game/client/MonopolyClientConfig.java | 8 +- .../java/pp/monopoly/game/server/Player.java | 8 +- .../monopoly/game/server/PlayerHandler.java | 6 +- .../monopoly/game/server/ServerGameLogic.java | 33 + .../message/server/BuyPropertyResponse.java | 28 +- .../message/server/EventDrawCard.java | 9 + .../pp/monopoly/message/server/GameOver.java | 9 + .../pp/monopoly/message/server/JailEvent.java | 10 + .../message/server/PlayerStatusUpdate.java | 24 + .../message/server/ServerInterpreter.java | 7 - .../message/server/TimeOutWarning.java | 10 + .../message/server/UpdatePlayerAssets.java | 16 - .../message/server/ViewAssetsResponse.java | 6 +- .../main/java/pp/monopoly/model/Board.java | 14 +- .../main/java/pp/monopoly/model/Figure.java | 306 +++- .../main/java/pp/monopoly/model/IntPoint.java | 4 +- .../main/java/pp/monopoly/model/Visitor.java | 8 + .../java/pp/monopoly/model/VoidVisitor.java | 6 + .../java/pp/monopoly/model/card/Card.java | 2 +- .../monopoly/model/fields/BoardManager.java | 80 +- .../monopoly/notification/ItemAddedEvent.java | 48 +- .../notification/ItemRemovedEvent.java | 28 +- .../java/pp/monopoly/notification/Sound.java | 57 +- .../src/main/resources/monopoly.properties | 1 + .../test/java/pp/monopoly/Testhandbuch.java | 2 + .../pp/monopoly/client/ClientLogicTest.java | 88 +- .../game/client/ClientGameLogicTest.java | 597 +------- .../game/server/ServerGameLogicTest.java | 1229 +++++++++++------ .../pp/monopoly/server/MonopolyServer.java | 4 +- 49 files changed, 2161 insertions(+), 1951 deletions(-) delete mode 100644 Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/UpdatePlayerAssets.java diff --git a/Projekte/battleship/client/src/main/java/pp/battleship/client/Menu.java b/Projekte/battleship/client/src/main/java/pp/battleship/client/Menu.java index 9143899..44a9a74 100644 --- a/Projekte/battleship/client/src/main/java/pp/battleship/client/Menu.java +++ b/Projekte/battleship/client/src/main/java/pp/battleship/client/Menu.java @@ -7,22 +7,21 @@ package pp.battleship.client; +import java.io.File; +import java.io.IOException; +import java.util.prefs.Preferences; + import com.simsilica.lemur.Button; import com.simsilica.lemur.Checkbox; import com.simsilica.lemur.Label; import com.simsilica.lemur.style.ElementId; +import static pp.battleship.Resources.lookup; import pp.battleship.client.gui.GameMusic; import pp.battleship.client.gui.VolumeSlider; import pp.dialog.Dialog; import pp.dialog.StateCheckboxModel; import pp.dialog.TextInputDialog; - -import java.io.File; -import java.io.IOException; -import java.util.prefs.Preferences; - -import static pp.battleship.Resources.lookup; import static pp.util.PreferencesUtils.getPreferences; /** @@ -39,7 +38,7 @@ class Menu extends Dialog { private final VolumeSlider slider; /** - * Constructs the Menu dialog for the Battleship application. + * Constructs the Menu dialog for the Battleship application.+ * * @param app the BattleshipApp instance */ diff --git a/Projekte/battleship/converter/src/main/java/pp/battleship/exporter/ModelExporter.java b/Projekte/battleship/converter/src/main/java/pp/battleship/exporter/ModelExporter.java index ae9350b..5a95a98 100644 --- a/Projekte/battleship/converter/src/main/java/pp/battleship/exporter/ModelExporter.java +++ b/Projekte/battleship/converter/src/main/java/pp/battleship/exporter/ModelExporter.java @@ -45,7 +45,12 @@ public class ModelExporter extends SimpleApplication { export("Models/BoatSmall/12219_boat_v2_L2.obj", "BoatSmall.j3o"); //NON-NLS export("Models/Battle/14084_WWII_Ship_German_Type_II_U-boat_v2_L1.obj", "Battle.j3o"); //NON-NLS export("Models/CV/essex_scb-125_generic.obj", "CV.j3o"); //NON-NLS - + export("Models/Figures/Würfel_blau.obj", "Würfel_blau.j30"); + export("Models/Figures/Würfel_gelb.obj", "Würfel_gelb.j30"); + export("Models/Figures/Würfel_grün.obj", "Würfel_grün.j30"); + export("Models/Figures/Würfel_rosa.obj", "Würfel_rosa.j30"); + export("Models/Figures/Würfel_rot.obj", "Würfel_rot.j30"); + export("Models/Figures/Würfel_schwarz.obj", "Würfel_schwarz.j30"); stop(); } diff --git a/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy b/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy index 55ef6cb..68a0f6e 100644 --- a/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy +++ b/Projekte/jme-common/src/main/resources/Interface/Lemur/pp-styles.groovy @@ -1,7 +1,8 @@ // Styling of Lemur components -// For documentation, see +// For documentation, see: // https://github.com/jMonkeyEngine-Contributions/Lemur/wiki/Styling - +import com.simsilica.lemur.* +import com.simsilica.lemur.component.QuadBackgroundComponent import com.simsilica.lemur.Button import com.simsilica.lemur.Button.ButtonAction import com.simsilica.lemur.Command @@ -11,19 +12,17 @@ import com.simsilica.lemur.component.QuadBackgroundComponent import com.simsilica.lemur.component.TbtQuadBackgroundComponent def bgColor = color(1, 1, 1, 1) -def buttonEnabledColor = color(0.8, 0.9, 1, 1) +def buttonEnabledColor = color(0, 0, 0, 1) def buttonDisabledColor = color(0.8, 0.9, 1, 0.2) -//def buttonBgColor = color(0, 0.75, 0.75, 1) +def buttonBgColor = color(1, 1, 1, 1) def sliderColor = color(0.6, 0.8, 0.8, 1) def sliderBgColor = color(0.5, 0.75, 0.75, 1) def gradientColor = color(0.5, 0.75, 0.85, 0.5) def tabbuttonEnabledColor = color(0.4, 0.45, 0.5, 1) +def solidWhiteBackground = new QuadBackgroundComponent(color(1, 1, 1, 1)) // Solid white +def greyBackground = color(0.8, 0.8, 0.8, 1) // Grey background color +def redBorderColor = color(1, 0, 0, 1) // Red border color -def playButtonBorderColor = color(1, 0.6, 0, 1) // Orange border for "Spielen" button -def playButtonTextColor = color(0, 0, 0, 1) // Black text color for "Spielen" button -def buttonBgColor = color(1, 1, 1, 1) // White background for "Spiel beenden" and "Einstellungen" buttons -def buttonTextColor = color(0, 0, 0, 1) // Black text color for "Spiel beenden" and "Einstellungen" buttons -def borderColor = color(0, 0, 0, 1) // Black border for "Spiel beenden" and "Einstellungen" def gradient = TbtQuadBackgroundComponent.create( @@ -34,7 +33,14 @@ def gradient = TbtQuadBackgroundComponent.create( def doubleGradient = new QuadBackgroundComponent(gradientColor) doubleGradient.texture = texture(name: "/com/simsilica/lemur/icons/double-gradient-128.png", - generateMips: false) + generateMips: false) + +def orangeBorder = TbtQuadBackgroundComponent.create( + texture(name: "/com/simsilica/lemur/icons/bordered-gradient.png", // Replace with an appropriate texture if needed + generateMips: false), + 1, 1, 1, 126, 126, + 1f, false) +orangeBorder.color = color(1, 0.5, 0, 1) // Orange color selector("pp") { font = font("Interface/Fonts/Metropolis/Metropolis-Regular-32.fnt") @@ -53,33 +59,31 @@ selector("header", "pp") { } selector("container", "pp") { - background = gradient.clone() + background = solidWhiteBackground.clone() background.setColor(bgColor) } +selector("toolbar") { + // Set the grey background + background = new QuadBackgroundComponent(greyBackground) + + // Add a red border using a TbtQuadBackgroundComponent + def redBorder = TbtQuadBackgroundComponent.create( + texture(name: "/com/simsilica/lemur/icons/bordered-gradient.png", + generateMips: false), + 1, 1, 1, 1, 1, + 1f, false) + redBorder.color = redBorderColor + background = greyBackground + + // Optional: Set padding inside the toolbar + insets = new Insets3f(10, 10, 10, 10) +} selector("slider", "pp") { background = gradient.clone() background.setColor(bgColor) } -selector("play-button", "pp") { - color = playButtonTextColor // Black text color - background = new QuadBackgroundComponent(playButtonBorderColor) // Orange border background - insets = new Insets3f(15, 25, 15, 25) // Padding for larger button size - background.setMargin(5, 5) // Thin border effect around the background color - fontSize = 36 // Larger font size for prominence -} - -selector("menu-button", "pp") { - color = buttonTextColor // Black text color - background = new QuadBackgroundComponent(buttonBgColor) // White background - insets = new Insets3f(10, 20, 10, 20) // Padding - background.setMargin(1, 1) // Thin black border - background.setColor(borderColor) // Set black border color - - fontSize = 24 // Standard font size -} - def pressedCommand = new Command