Update stage number upon stage order change in the component tree
This commit is contained in:
parent
b857da940a
commit
c33aa04dd9
@ -496,10 +496,24 @@ public class Rocket extends ComponentAssembly {
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
updateStageNumbers();
|
||||
updateStageMap();
|
||||
updateConfigurations();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update all the stage numbers based on their position in the component tree
|
||||
*/
|
||||
private void updateStageNumbers() {
|
||||
for (RocketComponent component : getChildren()) {
|
||||
if (component instanceof AxialStage) {
|
||||
AxialStage stage = (AxialStage) component;
|
||||
forgetStage(stage);
|
||||
stage.setStageNumber(getChildPosition(stage));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateStageMap(){
|
||||
for( RocketComponent component : getChildren() ){
|
||||
if (component instanceof AxialStage) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user