-
Notifications
You must be signed in to change notification settings - Fork 2
Subsystem Operation Manager
Nathan Gill edited this page Feb 1, 2020
·
1 revision
A Subsystem Operation Manager manages parts of a subsystem that are required for it to run.
You can create one for your subsystem with:
private SubsystemOperationManager operationManager = new SubsystemOperationManager("subsystem-name");
And make sure to also create a getter for it so commands and other subsystems can get the instance of it!
public SubsystemOperationManager getOperationManager() {
return this.operationManager;
}
Now other commands and subsystems can create operations for your operation manager. At any given moment, you can check if these operations are satisfied and your subsystem can operate using:
if (operationManager.allSatisfied()) {
// Everything is good to go!
} else {
// One or more of your registered operations isn't enabled. Don't go!
}