2014-08-08 17:05:49 -04:00
|
|
|
#include "RobotState.h"
|
|
|
|
|
|
2015-06-23 04:49:51 -07:00
|
|
|
RobotStateInterface* RobotState::impl = nullptr;
|
2014-08-08 17:05:49 -04:00
|
|
|
|
2015-06-25 15:07:55 -04:00
|
|
|
void RobotState::SetImplementation(RobotStateInterface* i) { impl = i; }
|
2014-08-08 17:05:49 -04:00
|
|
|
|
|
|
|
|
bool RobotState::IsDisabled() {
|
2015-06-25 15:07:55 -04:00
|
|
|
if (impl != nullptr) {
|
|
|
|
|
return impl->IsDisabled();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
2014-08-08 17:05:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RobotState::IsEnabled() {
|
2015-06-25 15:07:55 -04:00
|
|
|
if (impl != nullptr) {
|
|
|
|
|
return impl->IsEnabled();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2014-08-08 17:05:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RobotState::IsOperatorControl() {
|
2015-06-25 15:07:55 -04:00
|
|
|
if (impl != nullptr) {
|
|
|
|
|
return impl->IsOperatorControl();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
2014-08-08 17:05:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RobotState::IsAutonomous() {
|
2015-06-25 15:07:55 -04:00
|
|
|
if (impl != nullptr) {
|
|
|
|
|
return impl->IsAutonomous();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2014-08-08 17:05:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RobotState::IsTest() {
|
2015-06-25 15:07:55 -04:00
|
|
|
if (impl != nullptr) {
|
|
|
|
|
return impl->IsTest();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2014-08-08 17:05:49 -04:00
|
|
|
}
|