javadoc enums

This commit is contained in:
2024-12-07 19:22:51 +01:00
parent 39fd0ff7f0
commit cd22460ab8
5 changed files with 224 additions and 74 deletions

View File

@@ -1,16 +1,37 @@
package fr.monkhanny.dorfromantik.enums;
/**
* Enumération représentant les différents effets sonores utilisés dans l'application.
* Chaque valeur de l'énumération correspond à un effet sonore spécifique.
* Cette classe permet de récupérer le chemin d'accès au fichier sonore associé.
*
* @version 1.0
* @author Lenny FOULOU
*/
public enum Sounds {
SOUNDS1, SOUNDS2;
/**
* Effet sonore 1.
*/
SOUNDS1,
public String getSoundsPath() {
switch (this) {
case SOUNDS1:
return "./ressources/sounds/SFX/1.wav";
case SOUNDS2:
return "./ressources/sounds/SFX/2.wav";
default:
throw new IllegalArgumentException("Unexpected value: " + this);
/**
* Effet sonore 2.
*/
SOUNDS2;
/**
* Récupère le chemin du fichier sonore correspondant à l'énumération.
*
* @return Le chemin du fichier sonore
*/
public String getSoundsPath() {
switch (this) {
case SOUNDS1:
return "./ressources/sounds/SFX/1.wav";
case SOUNDS2:
return "./ressources/sounds/SFX/2.wav";
default:
throw new IllegalArgumentException("Unexpected value: " + this);
}
}
}
}
}