# HG changeset patch # User KarstenBock@gmx.net # Date 1316875686 -7200 # Node ID aed2e094e0c769c18fc24835591f2bbd9984702e # Parent a9cc5559ec2a007537c33cb5f884b8509c037714 Changed way of setting the possible components of the world. diff -r a9cc5559ec2a -r aed2e094e0c7 components/__init__.py --- a/components/__init__.py Sat Sep 24 15:48:24 2011 +0200 +++ b/components/__init__.py Sat Sep 24 16:48:06 2011 +0200 @@ -9,4 +9,19 @@ from change_map import ChangeMap from equipable import Equipable from equip import Equip -from general import General \ No newline at end of file +from general import General + +components = { + "general": General(), + "characterstats": CharacterStatistics(), + "containable": Containable(), + "container": Container(), + "description": Description(), + "dialogue": Dialogue(), + "fifeagent": FifeAgent(), + "lockable": Lockable(), + "usable": Usable(), + "change_map": ChangeMap(), + "equipable": Equipable(), + "equip": Equip(), + } \ No newline at end of file diff -r a9cc5559ec2a -r aed2e094e0c7 world.py --- a/world.py Sat Sep 24 15:48:24 2011 +0200 +++ b/world.py Sat Sep 24 16:48:06 2011 +0200 @@ -12,18 +12,8 @@ def configure(self): """Configure the game world's components, systems and renderers""" - self.components.general = components.General() - self.components.characterstats = components.CharacterStatistics() - self.components.containable = components.Containable() - self.components.container = components.Container() - self.components.description = components.Description() - self.components.dialogue = components.Dialogue() - self.components.fifeagent = components.FifeAgent() - self.components.lockable = components.Lockable() - self.components.usable = components.Usable() - self.components.change_map = components.ChangeMap() - self.components.equipable = components.Equipable() - self.components.equip = components.Equip() + for name, component in components.components.iteritems(): + setattr(self.components, name, component) def pump(self, dt): for component in self.components: