import javax.xml.bind.annotation.XmlRootElement;
/**
+ * The base class for all OpenRocket to Rocksim conversions.
*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlElement(name = "FinishCode")
private int finishCode = 0;
+ /**
+ * Default constructor.
+ */
protected BasePartDTO() {
}
+ /**
+ * Copy constructor of sorts, that performs all common conversions for components.
+ *
+ * @param ec
+ */
protected BasePartDTO(RocketComponent ec) {
setCalcCG(ec.getCG().x * RocksimHandler.ROCKSIM_TO_OPENROCKET_LENGTH);
setCalcMass(ec.getComponentMass() * RocksimHandler.ROCKSIM_TO_OPENROCKET_MASS);
material = material.substring(BaseHandler.ROCKSIM_MATERIAL_PREFIX.length());
}
setMaterial(material);
-
}
}