Un peu de ménage dans le git

This commit is contained in:
2024-12-02 20:51:28 +01:00
parent 0e6450f8c8
commit 9b2a314262
102 changed files with 49818 additions and 27 deletions

View File

@@ -0,0 +1,24 @@
package fr.monkhanny.dorfromantik.enums;
import java.awt.Color;
public enum Biome {
SEA, FIELD, PRE, FOREST, MOUNTAIN;
public Color[] getBiomeColors() {
switch (this) {
case SEA:
return new Color[] { new Color(25, 133, 208), new Color(53, 159, 235), new Color(0, 103, 178) };
case FIELD:
return new Color[] { new Color(232, 214, 28), new Color(247, 228, 28), new Color(210, 195, 0) };
case PRE:
return new Color[] { new Color(110, 190, 110), new Color(130, 210, 130), new Color(90, 170, 90) };
case FOREST:
return new Color[] { new Color(15, 110, 65), new Color(35, 130, 85), new Color(0, 90, 45) };
case MOUNTAIN:
return new Color[] { new Color(110, 110, 110), new Color(130, 130, 130), new Color(90, 90, 90) };
default:
throw new IllegalArgumentException("Unknown Biome : " + this);
}
}
}

View File

@@ -0,0 +1,42 @@
package fr.monkhanny.dorfromantik.enums;
import java.io.File;
import java.io.IOException;
import java.awt.Font;
import java.awt.FontFormatException;
public enum Fonts {
TITLE, BUTTON, SCORE;
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) {
try {
switch (this) {
case TITLE:
return Font.createFont(Font.TRUETYPE_FONT, new File("./ressources/fonts/Contage-Black.ttf")).deriveFont(size);
case BUTTON:
return Font.createFont(Font.TRUETYPE_FONT, new File("./ressources/fonts/Contage-Regular.ttf")).deriveFont(size);
case SCORE:
return Font.createFont(Font.TRUETYPE_FONT, new File("./ressources/fonts/Contage-Bold.ttf")).deriveFont(size);
default:
throw new IllegalArgumentException("Unexpected value: " + this);
}
} catch (IOException | FontFormatException e) {
e.printStackTrace();
// Retourner une police de secours si le fichier est introuvable ou s'il y a une erreur
return new Font("Arial", Font.PLAIN, (int) size);
}
}
}

View File

@@ -0,0 +1,25 @@
package fr.monkhanny.dorfromantik.enums;
public enum Images {
SETTINGS_ICON, EXIT_ICON, TUTORIAL_GIF1, TUTORIAL_GIF2, TUTORIAL_GIF3, TUTORIAL_GIF4;
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);
}
}
}

View File

@@ -0,0 +1,14 @@
package fr.monkhanny.dorfromantik.enums;
public enum Musics {
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);
}
}
}

View File

@@ -0,0 +1,16 @@
package fr.monkhanny.dorfromantik.enums;
public enum Sounds {
SOUNDS1, SOUNDS2;
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);
}
}
}

View File

@@ -0,0 +1,26 @@
package fr.monkhanny.dorfromantik.enums;
public enum TileOrientation {
NORTH, NORTH_EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, NORTH_WEST;
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);
}
}
}