2024-12-16 09:13:59 +01:00

53 lines
1.0 KiB
C++

#pragma once
namespace Passer::Control {
class CoreThing {
public:
// Participant *client;
unsigned char networkId;
/// @char The id of the thing
unsigned char id;
// CoreThing *parent;
/// @brief The type of Thing
unsigned char type;
const char *name = nullptr;
const char *modelUrl = nullptr;
// protected Sensor sensor;
/// @brief Basic Thing types
enum class Type {
Undetermined,
// Sensor,
Switch,
DistanceSensor,
DirectionalSensor,
TemperatureSensor,
// Motor,
ControlledMotor,
UncontrolledMotor,
Servo,
// Other
Humanoid,
ExternalSensor,
};
public:
CoreThing(unsigned char networkId = 0,
unsigned char thingType = (unsigned char)Type::Undetermined);
void SetName(const char *name);
// All things
private:
static CoreThing *allThings[];
static CoreThing *Get(unsigned char networkId, unsigned char thingId);
static int Add(CoreThing *thing);
protected:
virtual void Init();
};
} // namespace Passer::Control
using namespace Passer::Control;