mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[commands] Remove EndlessCommand (#4483)
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#include "frc2/command/CommandHelper.h"
|
||||
#include "frc2/command/CommandScheduler.h"
|
||||
#include "frc2/command/ConditionalCommand.h"
|
||||
#include "frc2/command/EndlessCommand.h"
|
||||
#include "frc2/command/InstantCommand.h"
|
||||
#include "frc2/command/ParallelCommandGroup.h"
|
||||
#include "frc2/command/ParallelDeadlineGroup.h"
|
||||
@@ -91,10 +90,6 @@ PerpetualCommand Command::Perpetually() && {
|
||||
WPI_UNIGNORE_DEPRECATED
|
||||
}
|
||||
|
||||
CommandPtr Command::Endlessly() && {
|
||||
return CommandPtr(std::move(*this).TransferOwnership()).Endlessly();
|
||||
}
|
||||
|
||||
CommandPtr Command::Repeatedly() && {
|
||||
return CommandPtr(std::move(*this).TransferOwnership()).Repeatedly();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "frc2/command/CommandScheduler.h"
|
||||
#include "frc2/command/ConditionalCommand.h"
|
||||
#include "frc2/command/EndlessCommand.h"
|
||||
#include "frc2/command/InstantCommand.h"
|
||||
#include "frc2/command/ParallelCommandGroup.h"
|
||||
#include "frc2/command/ParallelDeadlineGroup.h"
|
||||
@@ -26,11 +25,6 @@ CommandPtr CommandPtr::Repeatedly() && {
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
CommandPtr CommandPtr::Endlessly() && {
|
||||
m_ptr = std::make_unique<EndlessCommand>(std::move(m_ptr));
|
||||
return std::move(*this);
|
||||
}
|
||||
|
||||
CommandPtr CommandPtr::AsProxy() && {
|
||||
m_ptr = std::make_unique<ProxyScheduleCommand>(std::move(m_ptr));
|
||||
return std::move(*this);
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include "frc2/command/EndlessCommand.h"
|
||||
|
||||
using namespace frc2;
|
||||
|
||||
EndlessCommand::EndlessCommand(std::unique_ptr<Command>&& command) {
|
||||
if (!CommandGroupBase::RequireUngrouped(*command)) {
|
||||
return;
|
||||
}
|
||||
m_command = std::move(command);
|
||||
m_command->SetGrouped(true);
|
||||
AddRequirements(m_command->GetRequirements());
|
||||
}
|
||||
|
||||
void EndlessCommand::Initialize() {
|
||||
m_command->Initialize();
|
||||
}
|
||||
|
||||
void EndlessCommand::Execute() {
|
||||
m_command->Execute();
|
||||
}
|
||||
|
||||
void EndlessCommand::End(bool interrupted) {
|
||||
m_command->End(interrupted);
|
||||
}
|
||||
Reference in New Issue
Block a user