version 1.1.3
[debian/openrocket] / src / net / sf / openrocket / rocketcomponent / BodyTube.java
index b84478e7dc7f6578bb72a2e08173615f38fd717a..086c9efced9d03f6bbd8011c46e565ec86e066a0 100644 (file)
@@ -281,6 +281,24 @@ public class BodyTube extends SymmetricComponent implements MotorMount {
        }
        
        
+
+       /**
+        * Check whether the given type can be added to this component.  BodyTubes allow any
+        * InternalComponents or ExternalComponents, excluding BodyComponents, to be added.
+        * 
+        * @param type  The RocketComponent class type to add.
+        * @return      Whether such a component can be added.
+        */
+       @Override
+       public boolean isCompatible(Class<? extends RocketComponent> type) {
+               if (InternalComponent.class.isAssignableFrom(type))
+                       return true;
+               if (ExternalComponent.class.isAssignableFrom(type) &&
+                               !BodyComponent.class.isAssignableFrom(type))
+                       return true;
+               return false;
+       }
+       
        ////////////////  Motor mount  /////////////////
        
        @Override