diff --git a/src/fr/monkhanny/dorfromantik/enums/Fonts.java b/src/fr/monkhanny/dorfromantik/enums/Fonts.java index 8814054..351408a 100644 --- a/src/fr/monkhanny/dorfromantik/enums/Fonts.java +++ b/src/fr/monkhanny/dorfromantik/enums/Fonts.java @@ -5,23 +5,56 @@ import java.io.IOException; import java.awt.Font; import java.awt.FontFormatException; +/** + * Enumération représentant les différentes polices utilisées dans l'application. + * Les valeurs de l'énumération sont : TITLE, BUTTON et SCORE, chacune correspondant à un style de police spécifique. + * Cette classe permet de récupérer le chemin d'accès aux fichiers de police et de charger une police à une taille donnée. + * + * @version 1.0 + * @author Lenny FOULOU + */ public enum Fonts { - TITLE, BUTTON, SCORE; + /** + * Police utilisée pour les titres. + */ + TITLE, - public String getFontPath() { - switch (this) { - case TITLE: - return "./ressources/fonts/Contage-Black.ttf"; - case BUTTON: - return "./ressources/fonts/Contage-Regular.ttf"; - case SCORE: - return "./ressources/fonts/Contage-Bold.ttf"; - default: - throw new IllegalArgumentException("Unexpected value: " + this); + /** + * Police utilisée pour les boutons. + */ + BUTTON, + + /** + * Police utilisée pour les scores. + */ + SCORE; + + /** + * Récupère le chemin du fichier de police correspondant à l'énumération. + * + * @return Le chemin du fichier de police + */ + public String getFontPath() { + switch (this) { + case TITLE: + return "./ressources/fonts/Contage-Black.ttf"; + case BUTTON: + return "./ressources/fonts/Contage-Regular.ttf"; + case SCORE: + return "./ressources/fonts/Contage-Bold.ttf"; + default: + throw new IllegalArgumentException("Unexpected value: " + this); + } } - } - public Font getFont(float size) { + /** + * Charge la police correspondante à l'énumération et ajuste sa taille. + * Si une erreur se produit lors du chargement de la police, une police de secours (Arial) est utilisée. + * + * @param size La taille souhaitée de la police + * @return L'objet Font correspondant à l'énumération et à la taille donnée + */ + public Font getFont(float size) { try { switch (this) { case TITLE: @@ -39,4 +72,4 @@ public enum Fonts { return new Font("Arial", Font.PLAIN, (int) size); } } -} \ No newline at end of file +} diff --git a/src/fr/monkhanny/dorfromantik/enums/Images.java b/src/fr/monkhanny/dorfromantik/enums/Images.java index 78ed6c5..a560e7c 100644 --- a/src/fr/monkhanny/dorfromantik/enums/Images.java +++ b/src/fr/monkhanny/dorfromantik/enums/Images.java @@ -1,25 +1,65 @@ package fr.monkhanny.dorfromantik.enums; - +/** + * Enumération représentant les différentes images utilisées dans l'application. + * Chaque valeur de l'énumération correspond à une image spécifique (icônes et gifs). + * Cette classe permet de récupérer le chemin d'accès aux fichiers d'images associés. + * + * @version 1.0 + * @author Lenny FOULOU + */ public enum Images { - SETTINGS_ICON, EXIT_ICON, TUTORIAL_GIF1, TUTORIAL_GIF2, TUTORIAL_GIF3, TUTORIAL_GIF4; + /** + * Icône des paramètres. + */ + SETTINGS_ICON, - public String getImagePath() { - switch (this) { - case SETTINGS_ICON: - return "./ressources/images/Icone/SettingsIcon.png"; - case EXIT_ICON: - return "./ressources/images/Icone/ExitIcon.png"; - case TUTORIAL_GIF1: - return "./ressources/images/Tutorial/Gif1.gif"; - case TUTORIAL_GIF2: - return "./ressources/images/Tutorial/Gif2.gif"; - case TUTORIAL_GIF3: - return "./ressources/images/Tutorial/Gif3.gif"; - case TUTORIAL_GIF4: - return "./ressources/images/Tutorial/Gif4.gif"; - default: - throw new IllegalArgumentException("Unexpected value: " + this); + /** + * Icône de sortie. + */ + EXIT_ICON, + + /** + * Gif de la première étape du tutoriel. + */ + TUTORIAL_GIF1, + + /** + * Gif de la deuxième étape du tutoriel. + */ + TUTORIAL_GIF2, + + /** + * Gif de la troisième étape du tutoriel. + */ + TUTORIAL_GIF3, + + /** + * Gif de la quatrième étape du tutoriel. + */ + TUTORIAL_GIF4; + + /** + * Récupère le chemin du fichier d'image correspondant à l'énumération. + * + * @return Le chemin du fichier d'image + */ + public String getImagePath() { + switch (this) { + case SETTINGS_ICON: + return "./ressources/images/Icone/SettingsIcon.png"; + case EXIT_ICON: + return "./ressources/images/Icone/ExitIcon.png"; + case TUTORIAL_GIF1: + return "./ressources/images/Tutorial/Gif1.gif"; + case TUTORIAL_GIF2: + return "./ressources/images/Tutorial/Gif2.gif"; + case TUTORIAL_GIF3: + return "./ressources/images/Tutorial/Gif3.gif"; + case TUTORIAL_GIF4: + return "./ressources/images/Tutorial/Gif4.gif"; + default: + throw new IllegalArgumentException("Unexpected value: " + this); + } } - } -} \ No newline at end of file +} diff --git a/src/fr/monkhanny/dorfromantik/enums/Musics.java b/src/fr/monkhanny/dorfromantik/enums/Musics.java index 219f064..01f74a1 100644 --- a/src/fr/monkhanny/dorfromantik/enums/Musics.java +++ b/src/fr/monkhanny/dorfromantik/enums/Musics.java @@ -1,14 +1,30 @@ package fr.monkhanny.dorfromantik.enums; +/** + * Enumération représentant les différentes musiques utilisées dans l'application. + * Chaque valeur de l'énumération correspond à une musique spécifique. + * Cette classe permet de récupérer le chemin d'accès au fichier de musique associé. + * + * @version 1.0 + * @author Lenny FOULOU + */ public enum Musics { - MAIN_MENU_MUSIC; + /** + * Musique du menu principal. + */ + MAIN_MENU_MUSIC; - public String getSoundsPath() { - switch (this) { - case MAIN_MENU_MUSIC: - return "./ressources/sounds/Music/mainMenuMusic.wav"; - default: - throw new IllegalArgumentException("Unexpected value: " + this); + /** + * Récupère le chemin du fichier de musique correspondant à l'énumération. + * + * @return Le chemin du fichier de musique + */ + public String getSoundsPath() { + switch (this) { + case MAIN_MENU_MUSIC: + return "./ressources/sounds/Music/mainMenuMusic.wav"; + default: + throw new IllegalArgumentException("Unexpected value: " + this); + } } - } -} \ No newline at end of file +} diff --git a/src/fr/monkhanny/dorfromantik/enums/Sounds.java b/src/fr/monkhanny/dorfromantik/enums/Sounds.java index 772dac4..d95e53c 100644 --- a/src/fr/monkhanny/dorfromantik/enums/Sounds.java +++ b/src/fr/monkhanny/dorfromantik/enums/Sounds.java @@ -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); + } } - } -} \ No newline at end of file +} diff --git a/src/fr/monkhanny/dorfromantik/enums/TileOrientation.java b/src/fr/monkhanny/dorfromantik/enums/TileOrientation.java index 471ab80..00aaee7 100644 --- a/src/fr/monkhanny/dorfromantik/enums/TileOrientation.java +++ b/src/fr/monkhanny/dorfromantik/enums/TileOrientation.java @@ -1,26 +1,66 @@ package fr.monkhanny.dorfromantik.enums; - +/** + * Enumération représentant les différentes orientations possibles pour une tuile dans le jeu. + * Chaque orientation est définie par une direction cardinal ou intercardinale. + * + * @version 1.0 + * @author Lenny FOULOU + */ public enum TileOrientation { - NORTH, NORTH_EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, NORTH_WEST; + /** + * Orientation vers le nord. + */ + NORTH, + /** + * Orientation vers le nord-est. + */ + NORTH_EAST, - public TileOrientation oppositeOrientation() { - switch (this) { - case NORTH: - return SOUTH; - case NORTH_EAST: - return SOUTH_WEST; - case SOUTH_EAST: - return NORTH_WEST; - case SOUTH: - return NORTH; - case SOUTH_WEST: - return NORTH_EAST; - case NORTH_WEST: - return SOUTH_EAST; - default: - throw new IllegalArgumentException("Unknown TileOrientation: " + this); + /** + * Orientation vers le sud-est. + */ + SOUTH_EAST, + + /** + * Orientation vers le sud. + */ + SOUTH, + + /** + * Orientation vers le sud-ouest. + */ + SOUTH_WEST, + + /** + * Orientation vers le nord-ouest. + */ + NORTH_WEST; + + /** + * Retourne l'orientation opposée à celle-ci. + * Par exemple, si l'orientation actuelle est NORTH, l'orientation opposée sera SOUTH. + * + * @return L'orientation opposée. + * @throws IllegalArgumentException Si l'orientation est inconnue. + */ + public TileOrientation oppositeOrientation() { + switch (this) { + case NORTH: + return SOUTH; + case NORTH_EAST: + return SOUTH_WEST; + case SOUTH_EAST: + return NORTH_WEST; + case SOUTH: + return NORTH; + case SOUTH_WEST: + return NORTH_EAST; + case NORTH_WEST: + return SOUTH_EAST; + default: + throw new IllegalArgumentException("Unknown TileOrientation: " + this); + } } - } -} \ No newline at end of file +}