diff --git a/state.py b/state.py new file mode 100644 index 0000000..b7edfe7 --- /dev/null +++ b/state.py @@ -0,0 +1,6 @@ +from dataclasses import dataclass, field + + +@dataclass +class BaseGameState: + pass diff --git a/world.py b/world.py index c983345..0b4fc05 100644 --- a/world.py +++ b/world.py @@ -41,13 +41,12 @@ class World: yield entity, component_storage def get_components(self, entity: int, pop=False): - for componentstorage in self.registry.values(): - if entity in componentstorage: + for archetype in self.registry.values(): + if entity in archetype: if pop: - return componentstorage.pop(entity, None) + return archetype.pop(entity, None) else: - return componentstorage[entity] - return None + return archetype[entity] def tick(self, *args, **kwargs): for system in self.systems: