[commands] Refactor ProxyScheduleCommand, SelectCommand into ProxyCommand (#4534)

This commit is contained in:
Starlight220
2022-11-29 00:43:10 +02:00
committed by GitHub
parent e82cd5147b
commit 70080457d5
16 changed files with 214 additions and 43 deletions

View File

@@ -8,6 +8,7 @@
#include <span>
#include <wpi/SmallVector.h>
#include <wpi/deprecated.h>
#include "frc2/command/CommandBase.h"
#include "frc2/command/CommandHelper.h"
@@ -30,22 +31,14 @@ class ProxyScheduleCommand
* initialized, and ends when they are all no longer scheduled.
*
* @param toSchedule the commands to schedule
* @deprecated Replace with {@link ProxyCommand},
* composing multiple of them in a {@link ParallelRaceGroup} if needed.
*/
WPI_DEPRECATED("Replace with ProxyCommand")
explicit ProxyScheduleCommand(std::span<Command* const> toSchedule);
explicit ProxyScheduleCommand(Command* toSchedule);
/**
* Creates a new ProxyScheduleCommand that schedules the given command when
* initialized, and ends when it is no longer scheduled.
*
* <p>Note that this constructor passes ownership of the given command to the
* returned ProxyScheduleCommand.
*
* @param toSchedule the command to schedule
*/
explicit ProxyScheduleCommand(std::unique_ptr<Command>&& toSchedule);
ProxyScheduleCommand(ProxyScheduleCommand&& other) = default;
void Initialize() override;