Пример #1
0
  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));
      }
    }
  }
Пример #2
0
 @Override
 public String getCoordinates() {
   return "[" + system.getX() + "," + system.getY() + "," + system.getZ() + "]";
 }
Пример #3
0
 @Override
 public String getName() {
   return system.getName();
 }