Adds boilerplate for game state
This commit is contained in:
1 parent
4769b8d707
commit
8ad4106b36
2 files changed
+10
-5
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user