snakia.core.ecs.system
Functions
|
Cast a value to a type. |
|
|
|
Decorator for overloaded functions/methods. |
Classes
|
|
|
|
|
A processor is a class that processes the system. |
|
A system is a collection of entities and components that can be processed by processors. |
|
Type variable. |
|
Return a count object whose .__next__() method returns consecutive values. |
|
defaultdict(default_factory=None, /, [...]) --> dict with default factory |
- class snakia.core.ecs.system.System[source]
Bases:
objectA system is a collection of entities and components that can be processed by processors.
- get_component(component_type, /)[source]
Returns all entities with the given component.
- Return type:
Iterable[tuple[int,TypeVar(C, bound=Component)]]
- get_component_of_entity(entity, component_type, /, default=None)[source]
Returns the component of the given entity.
- Return type:
Any
- get_components(*component_types)[source]
Returns all entities with the given components.
- Return type:
Iterable[tuple[int,tuple[Component,...]]]
- get_components_of_entity(entity, /, *component_types)[source]
Returns the components of the given entity.
- Return type:
tuple[Any,...]
- get_processor(processor_type, /)[source]
Returns the first processor of the given type.
- Return type:
Optional[TypeVar(P, bound=Processor)]
- has_component(entity, component_type)[source]
Returns True if the entity has the given component.
- Return type:
bool
- has_components(entity, *component_types)[source]
Returns True if the entity has all the given components.
- Return type:
bool
- property is_running: bool
Returns True if the system is running.