2023-11-29 17:03:49 +01:00

36 lines
981 B
C++

#pragma once
namespace Passer {
namespace RoboidControl {
/// @brief A thing is a functional component on a robot
class Thing {
public:
Thing() { type = (int)Type::Undetermined; }
enum class Type {
Undetermined,
/// Sensor,
Switch,
DistanceSensor,
// Motor,
ControlledMotor,
UncontrolledMotor,
};
static const unsigned int MotorType = 0x8000;
static const unsigned int SensorType = 0x4000;
static const unsigned int SwitchType =
SensorType | (unsigned int)Type::Switch;
static const unsigned int DistanceSensorType =
SensorType | (unsigned int)Type::DistanceSensor;
static const unsigned int ControlledMotorType =
MotorType | (unsigned int)Type::ControlledMotor;
static const unsigned int UncontrolledMotorType =
MotorType | (unsigned int)Type::UncontrolledMotor;
unsigned int type = (int)Type::Undetermined;
};
} // namespace RoboidControl
} // namespace Passer
using namespace Passer::RoboidControl;