SystemImpl(SectorImpl sector, System system) { this.sector = sector; this.system = system; for (Object planetOrStar : system.getPlanetOrStar()) { if (planetOrStar instanceof Planet) { planetOrStars.add(new PlanetImpl(this, (Planet) planetOrStar)); } else if (planetOrStar instanceof Star) { planetOrStars.add(new StarImpl(this, (Star) planetOrStar)); } } }
@Override public String getCoordinates() { return "[" + system.getX() + "," + system.getY() + "," + system.getZ() + "]"; }
@Override public String getName() { return system.getName(); }