From 065049f6631d10823fd416a5c25570ab99ca1e77 Mon Sep 17 00:00:00 2001 From: Yvonne Schmidt Date: Mon, 2 Dec 2024 04:08:54 +0100 Subject: [PATCH] added documentation in client package --- .../java/pp/monopoly/client/GameMusic.java | 2 +- .../java/pp/monopoly/client/GameSound.java | 21 +++++++++++++++++++ .../java/pp/monopoly/client/MonopolyApp.java | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameMusic.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameMusic.java index 1e6f94e..6483174 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameMusic.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameMusic.java @@ -15,7 +15,7 @@ import com.jme3.audio.AudioData; import com.jme3.audio.AudioNode; /** - * Handles the background music beeing played. Is able to start and stop the music. Set the Volume of the Audio. + * Handles the background music being played. Is able to start and stop the music. Set the Volume of the Audio. */ public class GameMusic extends AbstractAppState{ private static final Logger LOGGER = System.getLogger(GameMusic.class.getName()); diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameSound.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameSound.java index 2722afa..942dfc2 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameSound.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/GameSound.java @@ -27,9 +27,25 @@ import static pp.util.PreferencesUtils.getPreferences; * An application state that plays sounds. */ public class GameSound extends AbstractAppState implements GameEventListener { + + /** + * Logger instance for logging messages related to GameSound. + */ private static final Logger LOGGER = System.getLogger(GameSound.class.getName()); + + /** + * Preferences instance for managing GameSound-related settings. + */ private static final Preferences PREFERENCES = getPreferences(GameSound.class); + + /** + * Preference key for enabling or disabling GameSound. + */ private static final String ENABLED_PREF = "enabled"; //NON-NLS + + /** + * Preference key for storing the volume level of GameSound. + */ private static final String VOLUME_PREF = "volume"; //NON-NLS private AudioNode passStartSound; @@ -223,6 +239,11 @@ public class GameSound extends AbstractAppState implements GameEventListener { PREFERENCES.putFloat(VOLUME_PREF, vol); } + /** + * Overrides {@link SoundEvent#notifyListener(GameEventListener)} + * @param event the received event + */ + @Override public void receivedEvent(SoundEvent event) { switch (event.sound()) { diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java index d2616a0..facb398 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java @@ -48,7 +48,7 @@ import pp.monopoly.notification.InfoTextEvent; import pp.monopoly.notification.Sound; /** - * The main class for the Battleship client application. + * The main class for the Monopoly client application. * It manages the initialization, input setup, GUI setup, and game states for the client. */ public class MonopolyApp extends SimpleApplication implements MonopolyClient, GameEventListener {