tcr/java/src/game/dimension/Galaxy.java
2025-03-16 17:40:47 +01:00

30 lines
600 B
Java
Executable file

package game.dimension;
import java.util.Set;
import com.google.common.collect.Sets;
public final class Galaxy extends Nameable implements Comparable<Galaxy> {
public final String id;
private final Set<Sector> sectors = Sets.newTreeSet();
public Galaxy(String id) {
this.id = id;
}
public void addSector(Sector sector) {
this.sectors.add(sector);
}
public int compareTo(Galaxy other) {
return other == null ? -1 : this.id.compareTo(other.id);
}
protected String getNameIdentifier() {
return "Galaxie %s";
}
protected String getIdentifier() {
return this.id;
}
}