Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Commands.java Add looseSequence() method #6639

Closed
wants to merge 11 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,25 @@ public static Command sequence(Command... commands) {
return new SequentialCommandGroup(commands);
}

/**
* Runs a group of commands in series, one after the other.
*
* <p>Each command is run individually by proxy. The requirements
* of each command are only for the duration of that command and
Oblarg marked this conversation as resolved.
Show resolved Hide resolved
* are not required for the entire group process.

* @param commands the commands to include
* @return the command group
* @see SequentialCommandGroup
*/
public static Command looseSequence(Command... commands) {
SequentialCommandGroup sequence = new SequentialCommandGroup();
for (Command command : commands) {
sequence.addCommands(command.asProxy());
}
return sequence;
}

/**
* Runs a group of commands in series, one after the other. Once the last command ends, the group
* is restarted.
Expand Down