mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[commands] Refactor lambda-based commands to inherit FunctionalCommand (#4451)
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
|
||||
#include <wpi/span.h>
|
||||
|
||||
#include "frc2/command/CommandBase.h"
|
||||
#include "frc2/command/CommandHelper.h"
|
||||
#include "frc2/command/FunctionalCommand.h"
|
||||
|
||||
namespace frc2 {
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ namespace frc2 {
|
||||
*
|
||||
* This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
class InstantCommand : public CommandHelper<CommandBase, InstantCommand> {
|
||||
class InstantCommand : public CommandHelper<FunctionalCommand, InstantCommand> {
|
||||
public:
|
||||
/**
|
||||
* Creates a new InstantCommand that runs the given Runnable with the given
|
||||
@@ -51,12 +51,5 @@ class InstantCommand : public CommandHelper<CommandBase, InstantCommand> {
|
||||
* only as a no-arg constructor to call implicitly from subclass constructors.
|
||||
*/
|
||||
InstantCommand();
|
||||
|
||||
void Initialize() override;
|
||||
|
||||
bool IsFinished() final;
|
||||
|
||||
private:
|
||||
std::function<void()> m_toRun;
|
||||
};
|
||||
} // namespace frc2
|
||||
|
||||
Reference in New Issue
Block a user