82 if (optionData ==
null)
return;
84 OptionId option = (OptionId) optionData;
88 dialog.addOptionSelectedText(option);
100 for (
int i = 0; i < genCount; i++) {
103 addText(
"Generated star system.");
107 for (
int i = 0; i < genCount; i++) {
110 addText(
"Generated star system.");
114 for (
int i = 0; i < genCount; i++) {
117 addText(
"Generated star system.");
121 ThemeGenContext context =
new ThemeGenContext();
122 Set<Constellation> c =
new HashSet<Constellation>();
124 if (system.getConstellation() ==
null)
continue;
125 for (StarSystemAPI curr : system.getConstellation().getSystems()) {
126 if (curr.isProcgen()) {
127 c.add(system.getConstellation());
132 context.constellations =
new ArrayList<Constellation>(c);
134 new RemnantThemeGenerator().generateForSector(context, 1f);
137 CustomConstellationParams params =
new CustomConstellationParams(
StarAge.
YOUNG);
140 params.forceNebula =
true;
142 params.systemTypes.add(StarSystemType.TRINARY_2CLOSE);
143 params.systemTypes.add(StarSystemType.SINGLE);
144 params.systemTypes.add(StarSystemType.TRINARY_1CLOSE_1FAR);
145 params.systemTypes.add(StarSystemType.NEBULA);
146 params.systemTypes.add(StarSystemType.SINGLE);
147 params.systemTypes.add(StarSystemType.BINARY_CLOSE);
148 params.systemTypes.add(StarSystemType.BINARY_CLOSE);
151 params.starTypes.add(
"black_hole");
152 params.starTypes.add(
"star_blue_giant");
153 params.starTypes.add(
"star_orange");
156 params.starTypes.add(
"star_neutron");
157 params.starTypes.add(
"star_neutron");
158 params.starTypes.add(
"star_neutron");
159 params.starTypes.add(
"star_neutron");
160 params.starTypes.add(
"nebula_center_average");
161 params.starTypes.add(
"black_hole");
162 params.starTypes.add(
"black_hole");
163 params.starTypes.add(
"black_hole");
164 params.starTypes.add(
"star_blue_giant");
168 addText(
"Generated star system.");
190 final Map<String, Integer> counts =
new HashMap<String, Integer>();
191 final Map<String, Integer> hab =
new HashMap<String, Integer>();
193 int totalPlanets = 0;
194 int totalSystems = 0;
197 int totalPlanetsInSystemsWithTerran = 0;
198 int maxPlanetsInSystemsWithTerran = 0;
201 if (!system.isProcgen())
continue;
203 String starType =
null;
204 if (system.getStar() !=
null) {
205 starType = system.getStar().getSpec().getName();
211 Set<String> seen =
new HashSet<String>();
212 for (PlanetAPI
planet : system.getPlanets()) {
213 if (
planet.getMarket() ==
null)
continue;
214 if (!
planet.getMarket().isPlanetConditionMarketOnly())
continue;
217 String type =
planet.getSpec().getName();
219 seen.add(
planet.getSpec().getPlanetType());
223 if (counts.containsKey(type)) {
224 count = counts.get(type);
227 counts.put(type, count);
229 if (
planet.getMarket().hasCondition(Conditions.HABITABLE)) {
232 if (starType !=
null) {
234 if (hab.containsKey(starType)) {
235 count = hab.get(starType);
238 hab.put(starType, count);
246 if (seen.contains(Planets.PLANET_TERRAN)) {
247 if (planets > maxPlanetsInSystemsWithTerran) {
248 maxPlanetsInSystemsWithTerran = planets;
250 totalPlanetsInSystemsWithTerran += planets;
254 List<String> list =
new ArrayList<String>(counts.keySet());
255 Collections.sort(list,
new Comparator<String>() {
256 public int compare(String o1, String o2) {
257 return counts.get(o2).compareTo(counts.get(o1));
260 List<String> habList =
new ArrayList<String>(hab.keySet());
261 Collections.sort(habList,
new Comparator<String>() {
262 public int compare(String o1, String o2) {
263 return hab.get(o2).compareTo(hab.get(o1));
268 print(String.format(
"Star systems: %4d", totalSystems));
269 print(String.format(
"Planets: %4d", totalPlanets));
270 print(String.format(
"Habitable %4d", totalHab));
271 print(String.format(
"Planets in systems with terran worlds: %4d", totalPlanetsInSystemsWithTerran));
272 print(String.format(
"Max planets in system with terran world: %4d", maxPlanetsInSystemsWithTerran));
273 if (totalPlanets > 0) {
274 print(
"Planet totals:");
275 for (String type : list) {
276 Integer count = counts.get(type);
277 String value = Misc.getRoundedValueMaxOneAfterDecimal((count * 100f) / totalPlanets) +
"%";
278 value +=
" (" + count +
")";
279 print(String.format(
" %-20s%10s", type, value));
285 print(
"Habitable totals by star:");
286 for (String type : habList) {
287 Integer count = hab.get(type);
288 String value = Misc.getRoundedValueMaxOneAfterDecimal((count * 100f) / totalHab) +
"%";
289 value +=
" (" + count +
")";
290 print(String.format(
" %-20s%10s", type, value));