mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
@@ -23,7 +23,7 @@
|
||||
#include "wpi/util/FunctionExtras.hpp"
|
||||
#include "wpi/util/deprecated.hpp"
|
||||
|
||||
using namespace frc2;
|
||||
using namespace wpi::cmd;
|
||||
|
||||
// Factories
|
||||
|
||||
@@ -73,7 +73,7 @@ CommandPtr cmd::Print(std::string_view msg) {
|
||||
return PrintCommand(msg).ToPtr();
|
||||
}
|
||||
|
||||
CommandPtr cmd::DeferredProxy(wpi::unique_function<Command*()> supplier) {
|
||||
CommandPtr cmd::DeferredProxy(wpi::util::unique_function<Command*()> supplier) {
|
||||
return Defer(
|
||||
[supplier = std::move(supplier)]() mutable {
|
||||
// There is no non-owning version of AsProxy(), so use the non-owning
|
||||
@@ -83,13 +83,13 @@ CommandPtr cmd::DeferredProxy(wpi::unique_function<Command*()> supplier) {
|
||||
{});
|
||||
}
|
||||
|
||||
CommandPtr cmd::DeferredProxy(wpi::unique_function<CommandPtr()> supplier) {
|
||||
CommandPtr cmd::DeferredProxy(wpi::util::unique_function<CommandPtr()> supplier) {
|
||||
return Defer([supplier = std::move(
|
||||
supplier)]() mutable { return supplier().AsProxy(); },
|
||||
{});
|
||||
}
|
||||
|
||||
CommandPtr cmd::Wait(units::second_t duration) {
|
||||
CommandPtr cmd::Wait(wpi::units::second_t duration) {
|
||||
return WaitCommand(duration).ToPtr();
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ CommandPtr cmd::Either(CommandPtr&& onTrue, CommandPtr&& onFalse,
|
||||
.ToPtr();
|
||||
}
|
||||
|
||||
CommandPtr cmd::Defer(wpi::unique_function<CommandPtr()> supplier,
|
||||
CommandPtr cmd::Defer(wpi::util::unique_function<CommandPtr()> supplier,
|
||||
Requirements requirements) {
|
||||
return DeferredCommand(std::move(supplier), requirements).ToPtr();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user