tinyecs 0.5.3__tar.gz → 0.5.3a0__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.
- {tinyecs-0.5.3/src/tinyecs.egg-info → tinyecs-0.5.3a0}/PKG-INFO +1 -1
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/pyproject.toml +1 -1
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/src/tinyecs/__init__.py +10 -9
- {tinyecs-0.5.3 → tinyecs-0.5.3a0/src/tinyecs.egg-info}/PKG-INFO +1 -1
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/tests/test_tinyecs.py +1 -2
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/LICENSE +0 -0
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/README.rst +0 -0
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/setup.cfg +0 -0
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/src/tinyecs/tutorial.py +0 -0
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/src/tinyecs.egg-info/SOURCES.txt +0 -0
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/src/tinyecs.egg-info/dependency_links.txt +0 -0
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/src/tinyecs.egg-info/requires.txt +0 -0
- {tinyecs-0.5.3 → tinyecs-0.5.3a0}/src/tinyecs.egg-info/top_level.txt +0 -0
|
@@ -353,7 +353,7 @@ def remove_system(fn: SystemFunction) -> None:
|
|
|
353
353
|
pass
|
|
354
354
|
|
|
355
355
|
|
|
356
|
-
def add_system_to_domain(domain: DomainID, system: SystemFunction, after=None) -> None:
|
|
356
|
+
def add_system_to_domain(domain: DomainID, *system: SystemFunction, after=None) -> None:
|
|
357
357
|
"""Create or extend a domain with the given system.
|
|
358
358
|
|
|
359
359
|
:param system: The system function
|
|
@@ -365,15 +365,16 @@ def add_system_to_domain(domain: DomainID, system: SystemFunction, after=None) -
|
|
|
365
365
|
.. important:: The system must first be registered with add_system.
|
|
366
366
|
"""
|
|
367
367
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
368
|
+
for s in system:
|
|
369
|
+
if s not in sidx:
|
|
370
|
+
raise UnknownSystemError(f'system {s} is not registered')
|
|
371
|
+
if domain not in didx:
|
|
372
|
+
didx[domain] = []
|
|
372
373
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
374
|
+
try:
|
|
375
|
+
didx[domain].insert(didx[domain].index(after) + 1, s)
|
|
376
|
+
except ValueError:
|
|
377
|
+
didx[domain].append(s)
|
|
377
378
|
|
|
378
379
|
|
|
379
380
|
def remove_system_from_domain(domain: DomainID, system: SystemFunction) -> None:
|
|
@@ -340,8 +340,7 @@ def test_stable_domain_order():
|
|
|
340
340
|
ecs.add_system(dummy_system2b, 'dummy_comp')
|
|
341
341
|
ecs.add_system(dummy_system3, 'dummy_comp')
|
|
342
342
|
|
|
343
|
-
ecs.add_system_to_domain('ze_domain', dummy_system1a)
|
|
344
|
-
ecs.add_system_to_domain('ze_domain', dummy_system2a)
|
|
343
|
+
ecs.add_system_to_domain('ze_domain', dummy_system1a, dummy_system2a)
|
|
345
344
|
assert ecs.didx['ze_domain'] == [dummy_system1a, dummy_system2a]
|
|
346
345
|
|
|
347
346
|
ecs.add_system_to_domain('ze_domain', dummy_system1b, after=dummy_system1a)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|