Fix AB6, code style
This commit is contained in:
@ -138,15 +138,13 @@ public class HierarchicalSystem implements CosmicSystem, MassiveIterable {
|
|||||||
public Massive next() {
|
public Massive next() {
|
||||||
if (cur != null && cur.hasNext()) return cur.next();
|
if (cur != null && cur.hasNext()) return cur.next();
|
||||||
|
|
||||||
for (; i < all.length; i++) {
|
while (i < all.length) {
|
||||||
CosmicSystem sys = all[i];
|
CosmicSystem sys = all[i++];
|
||||||
if (sys instanceof NamedBodyForcePair m) {
|
if (sys instanceof NamedBodyForcePair m) {
|
||||||
i++;
|
|
||||||
return m.getBody();
|
return m.getBody();
|
||||||
} else if (sys instanceof HierarchicalSystem hs) {
|
} else if (sys instanceof HierarchicalSystem hs) {
|
||||||
cur = hs.iterator();
|
cur = hs.iterator();
|
||||||
if (cur.hasNext()) {
|
if (cur.hasNext()) {
|
||||||
i++;
|
|
||||||
return cur.next();
|
return cur.next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -159,14 +157,14 @@ public class HierarchicalSystem implements CosmicSystem, MassiveIterable {
|
|||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
if (cur != null && cur.hasNext()) return true;
|
if (cur != null && cur.hasNext()) return true;
|
||||||
|
|
||||||
for (; i < all.length; i++) {
|
while (i < all.length) {
|
||||||
CosmicSystem sys = all[i];
|
CosmicSystem sys = all[i];
|
||||||
if (sys instanceof NamedBodyForcePair) {
|
if (sys instanceof NamedBodyForcePair) return true;
|
||||||
return true;
|
i++;
|
||||||
} else if (sys instanceof HierarchicalSystem hs) {
|
|
||||||
|
if (sys instanceof HierarchicalSystem hs) {
|
||||||
cur = hs.iterator();
|
cur = hs.iterator();
|
||||||
if (cur.hasNext()) {
|
if (cur.hasNext()) {
|
||||||
i++;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user