Réparation du score grâce à Luc (the goat)
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
package fr.monkhanny.dorfromantik.game;
|
||||
|
||||
import fr.monkhanny.dorfromantik.enums.Biome;
|
||||
import fr.monkhanny.dorfromantik.enums.TileOrientation;
|
||||
import java.awt.Point;
|
||||
import java.util.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Represents a connected pocket of tiles with the same biome.
|
||||
*/
|
||||
public class Pocket {
|
||||
private Biome biome;
|
||||
private Set<Tile> tiles; // Ensemble des tuiles de la poche
|
||||
private Set<Tile> tiles;
|
||||
|
||||
public Pocket(Biome biome) {
|
||||
this.biome = biome;
|
||||
@@ -20,24 +21,15 @@ public class Pocket {
|
||||
tiles.add(tile);
|
||||
}
|
||||
|
||||
public boolean containsTile(Tile tile) {
|
||||
return tiles.contains(tile);
|
||||
public int getSize() {
|
||||
return tiles.size();
|
||||
}
|
||||
|
||||
public Biome getBiome() {
|
||||
return biome;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return tiles.size();
|
||||
public Set<Tile> getTiles() {
|
||||
return tiles;
|
||||
}
|
||||
|
||||
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