removed type and id from thing constructor

This commit is contained in:
Pascal Serrarens 2025-06-02 12:42:14 +02:00
parent 80713e141a
commit ec47d9e22c

View File

@ -21,7 +21,9 @@ class Thing:
ControlledMotor = 0x06
UncontrolledMotor = 0x07
Servo = 0x08
RelativeEncoder = 0x19
# Other
Root = 0x10
Roboid = 0x09
Humanoid = 0x0A
ExternalSensor = 0x0B
@ -35,21 +37,19 @@ class Thing:
# region Init
def __init__(self, owner: Optional['Participant'] = None, parent: Optional['Thing'] = None, thing_type: int = Type.Undetermined, thing_id: int = 0) -> None:
def __init__(self, owner: Optional['Participant'] = None, parent: Optional['Thing'] = None) -> None:
"""! Create a new thing
@param owner The owning participant
@param parent The parent thing (will override owner if set)
@param thing_type The type of thing (can use \ref RoboidControl::Thing::Thing::Type "Thing.Type")
@param thingId The ID of the thing, leave out or set to zero to generate an ID
"""
## The participant owning this thing
self.owner: Optional['Participant'] = None
## The ID of the thing
self.id: int = thing_id
self.id: int = 0
## The type of the thing
#
## This can be either a \ref RoboidControl::Thing::Thing::Type "Thing.Type" or a byte value for custom types.
self.type: int = thing_type
self.type: int = Thing.Type.Undetermined
## The parent of this thing
self.parent: Optional[Thing] = None