Skip to content

Commit

Permalink
[commands] WrappedCommand: Call wrapped command initSendable (#6471)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaDizzy authored Apr 22, 2024
1 parent 98d2f45 commit 7bc0380
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package edu.wpi.first.wpilibj2.command;

import edu.wpi.first.util.sendable.SendableBuilder;
import java.util.Set;

/**
Expand Down Expand Up @@ -100,4 +101,9 @@ public boolean runsWhenDisabled() {
public InterruptionBehavior getInterruptionBehavior() {
return m_command.getInterruptionBehavior();
}

@Override
public void initSendable(SendableBuilder builder) {
m_command.initSendable(builder);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ Command::InterruptionBehavior WrapperCommand::GetInterruptionBehavior() const {
wpi::SmallSet<Subsystem*, 4> WrapperCommand::GetRequirements() const {
return m_command->GetRequirements();
}

void WrapperCommand::InitSendable(wpi::SendableBuilder& builder) {
m_command->InitSendable(builder);
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class WrapperCommand : public CommandHelper<Command, WrapperCommand> {

wpi::SmallSet<Subsystem*, 4> GetRequirements() const override;

void InitSendable(wpi::SendableBuilder& builder) override;

protected:
/// Command being wrapped.
std::unique_ptr<Command> m_command;
Expand Down

0 comments on commit 7bc0380

Please sign in to comment.