updates for 0.9.3
[debian/openrocket] / src / net / sf / openrocket / rocketcomponent / InnerTube.java
index fe485e277de118c5514f9eebee62cc3ec831acef..901b5cb60fe067fa910bc60919cc1ee918731295 100644 (file)
@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
+import net.sf.openrocket.motor.Motor;
 import net.sf.openrocket.util.Coordinate;
 import net.sf.openrocket.util.MathUtil;
 
@@ -139,6 +140,10 @@ implements Clusterable, RadialParent, MotorMount {
        }
 
 
+       /**
+        * Return the distance between the closest two cluster inner tube center points.
+        * This is equivalent to the cluster scale multiplied by the tube diameter.
+        */
        @Override
        public double getClusterSeparation() {
                return 2*getOuterRadius()*clusterScale;
@@ -273,4 +278,22 @@ implements Clusterable, RadialParent, MotorMount {
                this.overhang = overhang;
                fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);
        }
+       
+       
+       
+       /*
+        * (non-Javadoc)
+        * Copy the motor and ejection delay HashMaps.
+        * 
+        * @see rocketcomponent.RocketComponent#copy()
+        */
+       @SuppressWarnings("unchecked")
+       @Override
+       public RocketComponent copy() {
+               RocketComponent c = super.copy();
+               ((InnerTube)c).motors = (HashMap<String,Motor>) motors.clone();
+               ((InnerTube)c).ejectionDelays = (HashMap<String,Double>) ejectionDelays.clone();
+               return c;
+       }
+
 }
\ No newline at end of file