23 lines
652 B
C++
23 lines
652 B
C++
#include "Thing.h"
|
|
|
|
using namespace Passer::RoboidControl;
|
|
|
|
Thing::Thing() {
|
|
this->type = (unsigned int)Type::Undetermined;
|
|
}
|
|
|
|
const unsigned int Thing::SwitchType = SensorType | (unsigned int)Type::Switch;
|
|
const unsigned int Thing::DistanceSensorType =
|
|
SensorType | (unsigned int)Type::DistanceSensor;
|
|
const unsigned int Thing::ControlledMotorType =
|
|
MotorType | (unsigned int)Type::ControlledMotor;
|
|
const unsigned int Thing::UncontrolledMotorType =
|
|
MotorType | (unsigned int)Type::UncontrolledMotor;
|
|
|
|
bool Thing::IsMotor() {
|
|
return (type & Thing::MotorType) != 0;
|
|
}
|
|
|
|
bool Thing::IsSensor() {
|
|
return (type & Thing::SensorType) != 0;
|
|
} |