Ajouts des Hexagon + De la base de données + Ajout de variable d'environnement pour la sécurité

This commit is contained in:
2024-11-13 23:09:06 +01:00
parent 6551875575
commit 03e17d1882
8 changed files with 211 additions and 2 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,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);
}
}
}