tcod-ecs 5.2.4__tar.gz → 5.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/PKG-INFO +1 -1
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/_version.py +2 -2
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/entity.py +1 -1
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/query.py +25 -1
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/LICENSE +0 -0
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/README.md +0 -0
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/pyproject.toml +0 -0
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/__init__.py +0 -0
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/_converter.py +0 -0
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/callbacks.py +0 -0
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/constants.py +0 -0
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/py.typed +0 -0
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/registry.py +0 -0
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/typing.py +0 -0
- {tcod_ecs-5.2.4 → tcod_ecs-5.3.0}/tcod/ecs/world.py +0 -0
|
@@ -336,7 +336,7 @@ class BoundQuery:
|
|
|
336
336
|
def world(self) -> Registry:
|
|
337
337
|
"""Deprecated alias for registry.
|
|
338
338
|
|
|
339
|
-
.. deprecated::
|
|
339
|
+
.. deprecated:: 5.1
|
|
340
340
|
Use :any:`registry` instead.
|
|
341
341
|
"""
|
|
342
342
|
if __debug__:
|
|
@@ -404,6 +404,30 @@ class BoundQuery:
|
|
|
404
404
|
& self._query,
|
|
405
405
|
)
|
|
406
406
|
|
|
407
|
+
def any_of(
|
|
408
|
+
self,
|
|
409
|
+
components: Iterable[ComponentKey[object]] = (),
|
|
410
|
+
*,
|
|
411
|
+
tags: Iterable[object] = (),
|
|
412
|
+
relations: Iterable[_RelationQuery] = (),
|
|
413
|
+
traverse: Iterable[object] = (IsA,),
|
|
414
|
+
depth: int | None = None,
|
|
415
|
+
) -> Self:
|
|
416
|
+
"""Filter entities based on having at least one of the provided elements.
|
|
417
|
+
|
|
418
|
+
.. versionadded:: 5.3
|
|
419
|
+
"""
|
|
420
|
+
_check_suspicious_tags(tags, stacklevel=2)
|
|
421
|
+
return self.__class__(
|
|
422
|
+
self.registry,
|
|
423
|
+
_QueryLogicalAnd(
|
|
424
|
+
all_of=frozenset(
|
|
425
|
+
[_QueryLogicalOr(any_of=frozenset(self.__as_queries(components, tags, relations, traverse, depth)))]
|
|
426
|
+
)
|
|
427
|
+
)
|
|
428
|
+
& self._query,
|
|
429
|
+
)
|
|
430
|
+
|
|
407
431
|
def __iter__(self) -> Iterator[Entity]:
|
|
408
432
|
"""Iterate over the matching entities."""
|
|
409
433
|
return iter(self.get_entities())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|