Added convenience function RocketComponent.getMotorMounts() returning List<MotorMount>.

This commit is contained in:
Kevin Ruland 2012-05-16 06:49:04 +00:00
parent 7420f5c18b
commit ba4ceccf26
2 changed files with 340 additions and 329 deletions

View File

@ -70,15 +70,7 @@ public class EditMotorConfigurationDialog extends JDialog {
this.rocket = rocket;
ArrayList<MotorMount> mountList = new ArrayList<MotorMount>();
Iterator<RocketComponent> iterator = rocket.iterator();
while (iterator.hasNext()) {
RocketComponent c = iterator.next();
if (c instanceof MotorMount) {
mountList.add((MotorMount) c);
}
}
mounts = mountList.toArray(new MotorMount[0]);
mounts = rocket.getMotorMounts().toArray( new MotorMount[0]) ;