Un peu de ménage dans le git
This commit is contained in:
43
src/fr/monkhanny/dorfromantik/game/Pocket.java
Normal file
43
src/fr/monkhanny/dorfromantik/game/Pocket.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package fr.monkhanny.dorfromantik.game;
|
||||
|
||||
import fr.monkhanny.dorfromantik.enums.Biome;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class Pocket {
|
||||
private Biome biome;
|
||||
private Set<Tile> tiles; // Ensemble des tuiles de la poche
|
||||
|
||||
public Pocket(Biome biome) {
|
||||
this.biome = biome;
|
||||
this.tiles = new HashSet<>();
|
||||
}
|
||||
|
||||
public void addTile(Tile tile) {
|
||||
tiles.add(tile);
|
||||
}
|
||||
|
||||
public boolean containsTile(Tile tile) {
|
||||
return tiles.contains(tile);
|
||||
}
|
||||
|
||||
public Biome getBiome() {
|
||||
return biome;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return tiles.size();
|
||||
}
|
||||
|
||||
public int calculateScore() {
|
||||
// Calcul du score basé sur la taille de la poche
|
||||
return getSize() * getSize();
|
||||
}
|
||||
|
||||
public List<Tile> getTiles() {
|
||||
return new ArrayList<>(tiles);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user