コード例 #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();
 }