Skip to content

Commit

Permalink
[commands] WrappedCommand: Call wrapped command initSendable (wpilibs…
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaDizzy authored and chauser committed May 30, 2024
1 parent 4ca387b commit 90b295b
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 90b295b

Please sign in to comment.