34 lines
617 B
Java
34 lines
617 B
Java
package fr.monkhanny.dorfromantik.game;
|
|
|
|
import fr.monkhanny.dorfromantik.enums.Biome;
|
|
import java.util.*;
|
|
|
|
/**
|
|
* Represents a connected pocket of tiles with the same biome.
|
|
*/
|
|
public class Pocket {
|
|
private Biome biome;
|
|
private Set<Tile> tiles;
|
|
|
|
public Pocket(Biome biome) {
|
|
this.biome = biome;
|
|
this.tiles = new HashSet<>();
|
|
}
|
|
|
|
public void addTile(Tile tile) {
|
|
tiles.add(tile);
|
|
}
|
|
|
|
public int getSize() {
|
|
return tiles.size();
|
|
}
|
|
|
|
public Biome getBiome() {
|
|
return biome;
|
|
}
|
|
|
|
public Set<Tile> getTiles() {
|
|
return tiles;
|
|
}
|
|
}
|