mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[commands] Add proxy factory to Commands (#5603)
This commit is contained in:
@@ -151,6 +151,21 @@ public final class Commands {
|
||||
return new SelectCommand(commands, selector);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a command that schedules the command returned from the supplier when initialized,
|
||||
* and ends when it is no longer scheduled. The supplier is called when the command is
|
||||
* initialized.
|
||||
*
|
||||
* @param supplier the command supplier
|
||||
* @return the command
|
||||
* @see ProxyCommand
|
||||
*/
|
||||
public static Command deferredProxy(Supplier<Command> supplier) {
|
||||
return new ProxyCommand(supplier);
|
||||
}
|
||||
|
||||
// Command Groups
|
||||
|
||||
/**
|
||||
* Runs a group of commands in series, one after the other.
|
||||
*
|
||||
@@ -162,8 +177,6 @@ public final class Commands {
|
||||
return new SequentialCommandGroup(commands);
|
||||
}
|
||||
|
||||
// Command Groups
|
||||
|
||||
/**
|
||||
* Runs a group of commands in series, one after the other. Once the last command ends, the group
|
||||
* is restarted.
|
||||
|
||||
Reference in New Issue
Block a user