Campbell Crowley | c0cfb13 | 2015-12-30 20:58:02 -0800 | [diff] [blame] | 1 | #ifndef FRC971_WPILIB_NEWROBOTBASE_H_ |
| 2 | #define FRC971_WPILIB_NEWROBOTBASE_H_ |
| 3 | |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame^] | 4 | #include "frc971/wpilib/ahal/RobotBase.h" |
Campbell Crowley | c0cfb13 | 2015-12-30 20:58:02 -0800 | [diff] [blame] | 5 | |
| 6 | namespace frc971 { |
| 7 | namespace wpilib { |
| 8 | |
| 9 | class WPILibRobotBase { |
| 10 | public: |
| 11 | virtual void Run() = 0; |
| 12 | }; |
| 13 | |
| 14 | #define AOS_ROBOT_CLASS(_ClassName_) \ |
| 15 | START_ROBOT_CLASS(::frc971::wpilib::WPILibAdapterRobot<_ClassName_>) |
| 16 | |
| 17 | template <typename T> |
Parker Schuh | d3b7a887 | 2018-02-19 16:42:27 -0800 | [diff] [blame^] | 18 | class WPILibAdapterRobot : public frc::RobotBase { |
Campbell Crowley | c0cfb13 | 2015-12-30 20:58:02 -0800 | [diff] [blame] | 19 | public: |
| 20 | void StartCompetition() override { robot_.Run(); } |
| 21 | |
| 22 | private: |
| 23 | T robot_; |
| 24 | }; |
| 25 | |
Brian Silverman | 4be7ffe | 2016-01-02 14:16:06 -0800 | [diff] [blame] | 26 | } // namespace wpilib |
| 27 | } // namespace frc971 |
Campbell Crowley | c0cfb13 | 2015-12-30 20:58:02 -0800 | [diff] [blame] | 28 | |
Brian Silverman | 4be7ffe | 2016-01-02 14:16:06 -0800 | [diff] [blame] | 29 | #endif // FRC971_WPILIB_NEWROBOTBASE_H_ |