mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[commands] Revert "Change grouping decorator impl to flatten nested group structures (#3335)" (#4402)
This reverts commit ef4ea84cb5.
This commit is contained in:
@@ -52,9 +52,4 @@ public class EndlessCommand extends CommandBase {
|
||||
public boolean runsWhenDisabled() {
|
||||
return m_command.runsWhenDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EndlessCommand endlessly() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,10 +95,4 @@ public class ParallelCommandGroup extends CommandGroupBase {
|
||||
public boolean runsWhenDisabled() {
|
||||
return m_runWhenDisabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParallelCommandGroup alongWith(Command... parallel) {
|
||||
addCommands(parallel);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,10 +119,4 @@ public class ParallelDeadlineGroup extends CommandGroupBase {
|
||||
public boolean runsWhenDisabled() {
|
||||
return m_runWhenDisabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParallelDeadlineGroup deadlineWith(Command... parallel) {
|
||||
addCommands(parallel);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,10 +88,4 @@ public class ParallelRaceGroup extends CommandGroupBase {
|
||||
public boolean runsWhenDisabled() {
|
||||
return m_runWhenDisabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParallelRaceGroup raceWith(Command... parallel) {
|
||||
addCommands(parallel);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,10 +55,4 @@ public class PerpetualCommand extends CommandBase {
|
||||
public boolean runsWhenDisabled() {
|
||||
return m_command.runsWhenDisabled();
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal") // Command.perpetually()
|
||||
@Override
|
||||
public PerpetualCommand perpetually() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,9 +62,4 @@ public class RepeatCommand extends CommandBase {
|
||||
public boolean runsWhenDisabled() {
|
||||
return m_command.runsWhenDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepeatCommand repeatedly() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,28 +94,4 @@ public class SequentialCommandGroup extends CommandGroupBase {
|
||||
public boolean runsWhenDisabled() {
|
||||
return m_runWhenDisabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SequentialCommandGroup beforeStarting(Command before) {
|
||||
// store all the commands
|
||||
var commands = new ArrayList<Command>();
|
||||
commands.add(before);
|
||||
commands.addAll(m_commands);
|
||||
|
||||
// reset current state
|
||||
commands.forEach(CommandGroupBase::clearGroupedCommand);
|
||||
m_commands.clear();
|
||||
m_requirements.clear();
|
||||
m_runWhenDisabled = true;
|
||||
|
||||
// add them back
|
||||
addCommands(commands.toArray(Command[]::new));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SequentialCommandGroup andThen(Command... next) {
|
||||
addCommands(next);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user