38 template <std::derived_from<Command> Command1,
39 std::derived_from<Command> Command2>
41 std::function<
bool()> condition)
43 std::forward<Command1>(onTrue)),
45 std::forward<Command2>(onFalse)),
56 std::unique_ptr<Command>&& onFalse,
57 std::function<
bool()> condition);
68 void End(
bool interrupted)
override;
79 std::unique_ptr<Command> m_onTrue;
80 std::unique_ptr<Command> m_onFalse;
81 std::function<bool()> m_condition;
82 Command* m_selectedCommand{
nullptr};
83 bool m_runsWhenDisabled =
true;
typename std::decay< T >::type decay_t
Definition base.h:321
A state machine representing a complete action to be performed by the robot.
Definition Command.hpp:41
ConditionalCommand(const ConditionalCommand &other)=delete
bool RunsWhenDisabled() const override
InterruptionBehavior GetInterruptionBehavior() const override
ConditionalCommand(Command1 &&onTrue, Command2 &&onFalse, std::function< bool()> condition)
Creates a new ConditionalCommand.
Definition ConditionalCommand.hpp:40
void Initialize() override
ConditionalCommand(std::unique_ptr< Command > &&onTrue, std::unique_ptr< Command > &&onFalse, std::function< bool()> condition)
Creates a new ConditionalCommand.
void End(bool interrupted) override
ConditionalCommand(ConditionalCommand &&other)=default
bool IsFinished() override
void InitSendable(wpi::util::SendableBuilder &builder) override
Helper class for building Sendable dashboard representations.
Definition SendableBuilder.hpp:21
Definition StringMap.hpp:773
Definition CommandNiDsStadiaController.hpp:15