2024-05-20 15:03:46 +02:00
|
|
|
package com.charpentierbalocchi.dorfjavatik.model;
|
|
|
|
|
2024-05-20 20:09:18 +02:00
|
|
|
import java.awt.Color;
|
|
|
|
|
2024-05-20 15:03:46 +02:00
|
|
|
public class Tuile {
|
|
|
|
public enum Biome {
|
2024-05-20 20:09:18 +02:00
|
|
|
RIVIERE, FORET, CHAMP, VILLAGE, MONTAGNE
|
2024-05-20 15:03:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private Biome nord;
|
|
|
|
private Biome sud;
|
|
|
|
private Biome est;
|
|
|
|
private Biome ouest;
|
|
|
|
|
|
|
|
public Tuile(Biome nord, Biome sud, Biome est, Biome ouest) {
|
|
|
|
this.nord = nord;
|
|
|
|
this.sud = sud;
|
|
|
|
this.est = est;
|
|
|
|
this.ouest = ouest;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Biome getNord() {
|
|
|
|
return nord;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Biome getSud() {
|
|
|
|
return sud;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Biome getEst() {
|
|
|
|
return est;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Biome getOuest() {
|
|
|
|
return ouest;
|
|
|
|
}
|
|
|
|
|
2024-05-20 20:09:18 +02:00
|
|
|
public static Color getColorForBiome(Biome biome) {
|
|
|
|
switch (biome) {
|
|
|
|
case RIVIERE:
|
|
|
|
return Color.BLUE;
|
|
|
|
case FORET:
|
|
|
|
return Color.GREEN;
|
|
|
|
case CHAMP:
|
|
|
|
return Color.YELLOW;
|
|
|
|
case VILLAGE:
|
|
|
|
return Color.RED;
|
|
|
|
case MONTAGNE:
|
|
|
|
return Color.GRAY;
|
|
|
|
default:
|
|
|
|
return Color.BLACK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-20 15:03:46 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
2024-05-20 20:09:18 +02:00
|
|
|
return "[N: " + nord + ", S: " + sud + ", E: " + est + ", O: " + ouest + "]";
|
2024-05-20 15:03:46 +02:00
|
|
|
}
|
|
|
|
}
|