2014-08-08 17:05:49 -04:00
|
|
|
#include "RobotState.h"
|
|
|
|
|
|
|
|
|
|
RobotStateInterface* RobotState::impl = 0;
|
|
|
|
|
|
|
|
|
|
void RobotState::SetImplementation(RobotStateInterface* i) {
|
|
|
|
|
impl = i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RobotState::IsDisabled() {
|
2014-09-24 16:19:17 -04:00
|
|
|
if (impl != nullptr) {
|
2014-08-08 17:05:49 -04:00
|
|
|
return impl->IsDisabled();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RobotState::IsEnabled() {
|
2014-09-24 16:19:17 -04:00
|
|
|
if (impl != nullptr) {
|
2014-09-23 17:35:09 -04:00
|
|
|
return impl->IsEnabled();
|
2014-08-08 17:05:49 -04:00
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RobotState::IsOperatorControl() {
|
2014-09-24 16:19:17 -04:00
|
|
|
if (impl != nullptr) {
|
2014-09-23 17:35:09 -04:00
|
|
|
return impl->IsOperatorControl();
|
2014-08-08 17:05:49 -04:00
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RobotState::IsAutonomous() {
|
2014-09-24 16:19:17 -04:00
|
|
|
if (impl != nullptr) {
|
2014-09-23 17:35:09 -04:00
|
|
|
return impl->IsAutonomous();
|
2014-08-08 17:05:49 -04:00
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RobotState::IsTest() {
|
2014-09-24 16:19:17 -04:00
|
|
|
if (impl != nullptr) {
|
2014-09-23 17:35:09 -04:00
|
|
|
return impl->IsTest();
|
2014-08-08 17:05:49 -04:00
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|