pyecs.managers.SystemManager#
- class pyecs.managers.SystemManager[source]#
-
Methods
__init__
()register_system
(system)Register a new system with the system manager.
remove_system
(system)Remove a system from the system manager by reference.
Remove a system from the system manager by UUID.
update_all
(world, dt)Execute the update method for all registered systems.
- register_system(system)[source]#
Register a new system with the system manager.
This method assigns a unique UUID to the system and adds it to the systems list for execution during world updates.
Returns a tuple containing SYSTEM_REGISTERED status and the system on success, or FAILURE if the system is already registered.
- unregister_system(id)[source]#
Remove a system from the system manager by UUID.
This method removes the specified system from all tracking structures and prevents it from being executed during world updates.
Returns SYSTEM_UNREGISTERED on successful removal, or FAILURE if the system ID does not exist.
- Return type:
Literal
[<StatusCodes.SYSTEM_UNREGISTERED: 301>
,<StatusCodes.FAILURE: -1>
]- Parameters:
id (pyecs.common.Types.UUID4)
- remove_system(system)[source]#
Remove a system from the system manager by reference.
This convenience method allows removal using the System object directly rather than requiring the UUID. Internally delegates to unregister_system.
Returns SYSTEM_UNREGISTERED on successful removal, or FAILURE if the system is not currently registered.
- update_all(world, dt)[source]#
Execute the update method for all registered systems.
This method calls the update method on each registered system in registration order, passing the world instance and delta time.
Systems are responsible for querying entities and performing their specific logic during this update cycle.