From 8ad4106b36c5bce3f0d60d8b5a4311d2a3a9431c Mon Sep 17 00:00:00 2001 From: nejdetckenobi Date: Sat, 17 Oct 2026 17:01:16 +0300 Subject: [PATCH] Adds boilerplate for game state --- state.py | 6 ++++++ world.py | 9 ++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 state.py 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: