added documentation in client package

This commit is contained in:
Yvonne Schmidt 2024-12-02 04:08:54 +01:00
parent 580d81a621
commit 065049f663
3 changed files with 23 additions and 2 deletions

View File

@ -15,7 +15,7 @@ import com.jme3.audio.AudioData;
import com.jme3.audio.AudioNode; 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{ public class GameMusic extends AbstractAppState{
private static final Logger LOGGER = System.getLogger(GameMusic.class.getName()); private static final Logger LOGGER = System.getLogger(GameMusic.class.getName());

View File

@ -27,9 +27,25 @@ import static pp.util.PreferencesUtils.getPreferences;
* An application state that plays sounds. * An application state that plays sounds.
*/ */
public class GameSound extends AbstractAppState implements GameEventListener { 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()); 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); private static final Preferences PREFERENCES = getPreferences(GameSound.class);
/**
* Preference key for enabling or disabling GameSound.
*/
private static final String ENABLED_PREF = "enabled"; //NON-NLS 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 static final String VOLUME_PREF = "volume"; //NON-NLS
private AudioNode passStartSound; private AudioNode passStartSound;
@ -223,6 +239,11 @@ public class GameSound extends AbstractAppState implements GameEventListener {
PREFERENCES.putFloat(VOLUME_PREF, vol); PREFERENCES.putFloat(VOLUME_PREF, vol);
} }
/**
* Overrides {@link SoundEvent#notifyListener(GameEventListener)}
* @param event the received event
*/
@Override @Override
public void receivedEvent(SoundEvent event) { public void receivedEvent(SoundEvent event) {
switch (event.sound()) { switch (event.sound()) {

View File

@ -48,7 +48,7 @@ import pp.monopoly.notification.InfoTextEvent;
import pp.monopoly.notification.Sound; 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. * It manages the initialization, input setup, GUI setup, and game states for the client.
*/ */
public class MonopolyApp extends SimpleApplication implements MonopolyClient, GameEventListener { public class MonopolyApp extends SimpleApplication implements MonopolyClient, GameEventListener {