private static double GetChildHeight(double height, ISpaceCraft spacecraft) { PropertyInfo prop = spacecraft.GetType().GetProperty("GetAeroDynamicProperties"); AeroDynamicProperties props = (AeroDynamicProperties)prop.GetValue(spacecraft, null); if (props == AeroDynamicProperties.ExtendsFineness) { height += spacecraft.Height; } foreach (ISpaceCraft child in spacecraft.Children) { height = GetChildHeight(height, child); } return(height); }