RoboidControl-cpp/Thing.cpp
2023-12-30 09:28:09 +01:00

18 lines
723 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;
const unsigned int Thing::ExternalType = (unsigned int)Type::ExternalSensor;
bool Thing::IsMotor() { return (type & Thing::MotorType) != 0; }
bool Thing::IsSensor() { return (type & Thing::SensorType) != 0; }