Mercurial > parpg-source
annotate world.py @ 49:4f9747116061
Removed behaviour component. Behaviour is already stored in the fifeagent component.
author | KarstenBock@gmx.net |
---|---|
date | Thu, 08 Sep 2011 14:30:01 +0200 |
parents | 66a06de1bddc |
children | d3a9caba067b |
rev | line source |
---|---|
41
ff3e395abf91
Renamed grease to bGrease (Basic Grease) to get rid of conflicts with an already installed grease.
KarstenBock@gmx.net
parents:
38
diff
changeset
|
1 from bGrease.world import * |
38 | 2 |
8
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
3 from parpg.mode import FifeMode |
38 | 4 from parpg import components |
5 | 5 |
8
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
6 class World(FifeMode, BaseWorld): |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
7 |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
8 def __init__(self): |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
9 FifeMode.__init__(self) |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
10 BaseWorld.__init__(self) |
38 | 11 |
12 def configure(self): | |
13 """Configure the game world's components, systems and renderers""" | |
14 self.components.characterstats = components.CharacterStatistics() | |
15 self.components.containable = components.Containable() | |
16 self.components.container = components.Container() | |
17 self.components.description = components.Description() | |
42 | 18 self.components.dialogue = components.Dialogue() |
38 | 19 self.components.fifeagent = components.FifeAgent() |
20 self.components.lockable = components.Lockable() | |
21 self.components.usable = components.Usable() | |
5 | 22 |
23 def pump(self, dt): | |
8
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
24 for component in self.components: |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
25 if hasattr(component, "step"): |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
26 component.step(dt) |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
27 for system in self.systems: |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
28 if hasattr(system, "step"): |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
29 system.step(dt) |