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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tcod-ecs
3
- Version: 5.2.4
3
+ Version: 5.3.0
4
4
  Summary: A type-hinted Entity Component System based on Python dictionaries and sets.
5
5
  Author-email: Kyle Benesch <4b796c65+github@gmail.com>
6
6
  Requires-Python: >=3.8
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '5.2.4'
21
- __version_tuple__ = version_tuple = (5, 2, 4)
20
+ __version__ = version = '5.3.0'
21
+ __version_tuple__ = version_tuple = (5, 3, 0)
@@ -77,7 +77,7 @@ class Entity:
77
77
  def world(self) -> Registry:
78
78
  """Deprecated alias for registry.
79
79
 
80
- .. deprecated:: Unreleased
80
+ .. deprecated:: 5.1
81
81
  Use :any:`registry` instead.
82
82
  """
83
83
  if __debug__:
@@ -336,7 +336,7 @@ class BoundQuery:
336
336
  def world(self) -> Registry:
337
337
  """Deprecated alias for registry.
338
338
 
339
- .. deprecated:: Unreleased
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