mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Add templates for new commands for vscode plugin (#2016)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "ReplaceMeCommand2.h"
|
||||
|
||||
ReplaceMeCommand2::ReplaceMeCommand2() {
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
||||
// Called when the command is initially scheduled.
|
||||
void ReplaceMeCommand2::Initialize() {}
|
||||
|
||||
// Called repeatedly when this Command is scheduled to run
|
||||
void ReplaceMeCommand2::Execute() {}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
void ReplaceMeCommand2::End(bool interrupted) {}
|
||||
|
||||
// Returns true when the command should end.
|
||||
bool ReplaceMeCommand2::IsFinished() { return false; }
|
||||
@@ -0,0 +1,32 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandBase.h>
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
|
||||
/**
|
||||
* An example command.
|
||||
*
|
||||
* <p>Note that this extends CommandHelper, rather extending CommandBase
|
||||
* directly; this is crucially important, or else the decorator functions in
|
||||
* Command will *not* work!
|
||||
*/
|
||||
class ReplaceMeCommand2
|
||||
: public frc2::CommandHelper<frc2::CommandBase, ReplaceMeCommand2> {
|
||||
public:
|
||||
ReplaceMeCommand2();
|
||||
|
||||
void Initialize() override;
|
||||
|
||||
void Execute() override;
|
||||
|
||||
void End(bool interrupted) override;
|
||||
|
||||
bool IsFinished() override;
|
||||
};
|
||||
Reference in New Issue
Block a user