[commands] Revert "Change grouping decorator impl to flatten nested group structures (#3335)" (#4402)

This reverts commit ef4ea84cb5.
This commit is contained in:
Starlight220
2022-09-07 19:04:21 +03:00
committed by GitHub
parent 0389bf5214
commit d9b4e7b8bf
16 changed files with 14 additions and 134 deletions

View File

@@ -52,9 +52,4 @@ public class EndlessCommand extends CommandBase {
public boolean runsWhenDisabled() {
return m_command.runsWhenDisabled();
}
@Override
public EndlessCommand endlessly() {
return this;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -62,9 +62,4 @@ public class RepeatCommand extends CommandBase {
public boolean runsWhenDisabled() {
return m_command.runsWhenDisabled();
}
@Override
public RepeatCommand repeatedly() {
return this;
}
}

View File

@@ -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;
}
}