30 lines
600 B
Java
Executable file
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;
|
|
}
|
|
}
|