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 | |
| 4 | #include "RobotBase.h" |
| 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> |
| 18 | class WPILibAdapterRobot : public RobotBase { |
| 19 | public: |
| 20 | void StartCompetition() override { robot_.Run(); } |
| 21 | |
| 22 | private: |
| 23 | T robot_; |
| 24 | }; |
| 25 | |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | #endif // FRC971_WPILIB_NEWROBOTBASE_H_ |
| 30 | |