8#include <initializer_list>
37 std::function<
void()> onExecute,
38 std::function<
void(
bool)> onEnd,
39 std::function<
bool()> isFinished,
40 std::initializer_list<Subsystem*> requirements);
53 std::function<
void()> onExecute,
54 std::function<
void(
bool)> onEnd,
55 std::function<
bool()> isFinished,
56 std::span<Subsystem* const> requirements = {});
66 void End(
bool interrupted)
override;
71 std::function<void()> m_onInit;
72 std::function<void()> m_onExecute;
73 std::function<void(
bool)> m_onEnd;
74 std::function<bool()> m_isFinished;
CRTP implementation to allow polymorphic decorator functions in Command.
Definition: CommandHelper.h:26
A command that allows the user to pass in functions for each of the basic command methods through the...
Definition: FunctionalCommand.h:24
void End(bool interrupted) override
The action to take when the command ends.
FunctionalCommand(std::function< void()> onInit, std::function< void()> onExecute, std::function< void(bool)> onEnd, std::function< bool()> isFinished, std::initializer_list< Subsystem * > requirements)
Creates a new FunctionalCommand.
FunctionalCommand(FunctionalCommand &&other)=default
void Initialize() override
The initial subroutine of a command.
FunctionalCommand(std::function< void()> onInit, std::function< void()> onExecute, std::function< void(bool)> onEnd, std::function< bool()> isFinished, std::span< Subsystem *const > requirements={})
Creates a new FunctionalCommand.
bool IsFinished() override
Whether the command has finished.
FunctionalCommand(const FunctionalCommand &other)=default
void Execute() override
The main body of a command.
Definition: InstantCommand.h:14