17 lines
384 B
Python
17 lines
384 B
Python
class Scene:
|
|
def __init__(self):
|
|
self.entities = {}
|
|
|
|
def add(self, entity):
|
|
self.entities[entity.name] = entity
|
|
entity.scene = self
|
|
entity.load()
|
|
|
|
def unload(self):
|
|
for entity in self.entities.values():
|
|
entity.unregister()
|
|
|
|
def load(self):
|
|
for entity in self.entities.values():
|
|
entity.register()
|