[1373] Add hasRecoveryDevice to FlighConfiguration
This commit is contained in:
parent
e97d5c53d4
commit
87b225b38b
@ -548,6 +548,24 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
|||||||
updateActiveInstances();
|
updateActiveInstances();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if a rocket has a configured Recovery Device
|
||||||
|
*/
|
||||||
|
public boolean hasRecoveryDevice() {
|
||||||
|
Rocket rkt = this.getRocket();
|
||||||
|
RocketComponent nextComponent = rkt.getNextComponent();
|
||||||
|
|
||||||
|
while(nextComponent != null) {
|
||||||
|
if(nextComponent instanceof RecoveryDevice) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
nextComponent = nextComponent.getNextComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/////////////// Helper methods ///////////////
|
/////////////// Helper methods ///////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user