[1373] Add hasRecoveryDevice to FlighConfiguration
This commit is contained in:
parent
e97d5c53d4
commit
87b225b38b
@ -547,7 +547,25 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
|
||||
updateMotors();
|
||||
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 ///////////////
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user