2016-11-18 17:42:40 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2018-01-02 09:20:21 -08:00
|
|
|
/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
|
2016-11-18 17:42:40 -05:00
|
|
|
/* 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
|
|
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
#include <wpi/Twine.h>
|
2016-11-18 17:42:40 -05:00
|
|
|
|
|
|
|
|
#include "Commands/Command.h"
|
|
|
|
|
|
|
|
|
|
namespace frc {
|
|
|
|
|
|
2016-11-19 00:26:22 -08:00
|
|
|
/**
|
|
|
|
|
* This command will execute once, then finish immediately afterward.
|
|
|
|
|
*
|
2017-11-16 00:33:51 -08:00
|
|
|
* Subclassing InstantCommand is shorthand for returning true from IsFinished().
|
2016-11-19 00:26:22 -08:00
|
|
|
*/
|
2016-11-18 17:42:40 -05:00
|
|
|
class InstantCommand : public Command {
|
|
|
|
|
public:
|
2018-04-29 23:33:19 -07:00
|
|
|
explicit InstantCommand(const wpi::Twine& name);
|
2016-11-18 17:42:40 -05:00
|
|
|
InstantCommand() = default;
|
|
|
|
|
virtual ~InstantCommand() = default;
|
|
|
|
|
|
|
|
|
|
protected:
|
2016-11-19 00:26:22 -08:00
|
|
|
bool IsFinished() override;
|
2016-11-18 17:42:40 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace frc
|