Mercurial > parpg-source
comparison world.py @ 87:aed2e094e0c7
Changed way of setting the possible components of the world.
author | KarstenBock@gmx.net |
---|---|
date | Sat, 24 Sep 2011 16:48:06 +0200 |
parents | a9cc5559ec2a |
children | 79d6b17b80a3 |
comparison
equal
deleted
inserted
replaced
86:a9cc5559ec2a | 87:aed2e094e0c7 |
---|---|
10 FifeMode.__init__(self) | 10 FifeMode.__init__(self) |
11 BaseWorld.__init__(self) | 11 BaseWorld.__init__(self) |
12 | 12 |
13 def configure(self): | 13 def configure(self): |
14 """Configure the game world's components, systems and renderers""" | 14 """Configure the game world's components, systems and renderers""" |
15 self.components.general = components.General() | 15 for name, component in components.components.iteritems(): |
16 self.components.characterstats = components.CharacterStatistics() | 16 setattr(self.components, name, component) |
17 self.components.containable = components.Containable() | |
18 self.components.container = components.Container() | |
19 self.components.description = components.Description() | |
20 self.components.dialogue = components.Dialogue() | |
21 self.components.fifeagent = components.FifeAgent() | |
22 self.components.lockable = components.Lockable() | |
23 self.components.usable = components.Usable() | |
24 self.components.change_map = components.ChangeMap() | |
25 self.components.equipable = components.Equipable() | |
26 self.components.equip = components.Equip() | |
27 | 17 |
28 def pump(self, dt): | 18 def pump(self, dt): |
29 for component in self.components: | 19 for component in self.components: |
30 if hasattr(component, "step"): | 20 if hasattr(component, "step"): |
31 component.step(dt) | 21 component.step(dt) |