Adds boilerplate for game state

This commit is contained in:
nejdetckenobi committed 2026-10-17 17:01:16 +03:00
1 parent 4769b8d707
commit 8ad4106b36
2 files changed
+10 -5

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
from dataclasses import dataclass, field
@dataclass
class BaseGameState:
pass
+4 -5
View File
@@ -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: