Pascal Serrarens f33b02311c Updated Thing
2023-12-05 11:13:13 +01:00

47 lines
1.1 KiB
C++

#pragma once
namespace Passer {
namespace RoboidControl {
/// @brief A thing is a functional component on a robot
class Thing {
public:
/// @brief Default constructor for a Thing
Thing();
/// @brief The type of Thing
unsigned int type;
static const unsigned int SwitchType;
static const unsigned int DistanceSensorType;
static const unsigned int ControlledMotorType;
static const unsigned int UncontrolledMotorType;
/// @brief Check if the Thing is a Motor
/// @returns True when the Thing is a Motor and False otherwise
bool IsMotor();
/// @brief Check if the Thing is a Sensor
/// @returns True when the Thing is a Sensor and False otherwise
bool IsSensor();
protected:
/// @brief Bitmask for Motor type
static const unsigned int MotorType = 0x8000;
/// @brief Bitmap for Sensor type
static const unsigned int SensorType = 0x4000;
/// @brief Basic Thing types
enum class Type {
Undetermined,
// Sensor,
Switch,
DistanceSensor,
// Motor,
ControlledMotor,
UncontrolledMotor,
};
};
} // namespace RoboidControl
} // namespace Passer
using namespace Passer::RoboidControl;