[commands] Disambiguate ProxyCommand and DeferredCommand (#6324)

This commit is contained in:
DeltaDizzy
2024-04-28 00:41:04 -05:00
committed by GitHub
parent 39d33bfca6
commit 1e4a647918
8 changed files with 69 additions and 33 deletions

View File

@@ -4,6 +4,7 @@
#include "frc2/command/ProxyCommand.h"
#include <fmt/core.h>
#include <wpi/sendable/SendableBuilder.h>
using namespace frc2;
@@ -20,11 +21,11 @@ ProxyCommand::ProxyCommand(wpi::unique_function<CommandPtr()> supplier)
ProxyCommand::ProxyCommand(Command* command)
: ProxyCommand([command] { return command; }) {
SetName(std::string{"Proxy("}.append(command->GetName()).append(")"));
SetName(fmt::format("Proxy({})", command->GetName()));
}
ProxyCommand::ProxyCommand(std::unique_ptr<Command> command) {
SetName(std::string{"Proxy("}.append(command->GetName()).append(")"));
SetName(fmt::format("Proxy({})", command->GetName()));
m_supplier = [command = std::move(command)] { return command.get(); };
}