18 if (context.lagrangeParent ==
null || context.lagrangePointType ==
null)
return null;
23 if (context.parent !=
null) parent = context.parent;
24 if (context.lagrangeParent !=
null) parent = context.center;
26 if (parent ==
null)
return null;
29 for (
int i = 5; i <= 11; i++) {
30 sizePicker.
add(i, 20 - i);
33 int size = sizePicker.
pick();
34 float radius = size * 100f;
36 float maxRadius = (context.currentRadius - parent.
getRadius()) * 0.5f;
37 if (radius > maxRadius) radius = maxRadius;
38 if (radius < 400) radius = 400;
40 float area = radius * radius * 3.14f;
41 int count = (int) (area / 80000f);
42 if (count < 10) count = 10;
43 if (count > 100) count = 100;
47 float orbitRadius = context.currentRadius + radius;
51 if (context.lagrangeParent !=
null) {
52 orbitRadius = context.lagrangeParent.orbitRadius;
53 orbitDays = context.lagrangeParent.orbitDays;
56 angle = context.lagrangeParent.orbitAngle + angleOffset;
60 new AsteroidFieldParams(
73 float prevRadius = context.currentRadius;
78 ", orbit index " + (context.parent !=
null ? context.parentOrbitIndex : context.orbitIndex));
83 System.out.println(
" Nothing to pick");
86 System.out.println(
" Picked: " + pick.
getId());
93 context.currentRadius = orbitRadius;
95 GenResult result = context.gen.
addPlanet(context, planetData,
true,
false);
96 if (result !=
null && !result.entities.isEmpty()) {
98 if (context.lagrangeParent !=
null && !result.entities.isEmpty()) {
111 context.parentRadiusOverride = -1;
112 context.currentRadius = prevRadius;
116 GenResult result =
new GenResult();
117 result.onlyIncrementByWidth =
false;
118 result.orbitalWidth = radius * 2f;
119 result.entities.add(field);