Mercurial > parpg-source
annotate world.py @ 26:da8589a71d94
Added component to store the possible actions for an object.
author | KarstenBock@gmx.net |
---|---|
date | Sun, 04 Sep 2011 13:44:10 +0200 |
parents | 708a6f651c31 |
children | b30a72c41f90 |
rev | line source |
---|---|
8
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
1 from parpg.grease.world import * |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
2 from parpg.mode import FifeMode |
5 | 3 |
8
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
4 class World(FifeMode, BaseWorld): |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
5 |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
6 def __init__(self): |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
7 FifeMode.__init__(self) |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
8 BaseWorld.__init__(self) |
5 | 9 |
10 def pump(self, dt): | |
8
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
11 for component in self.components: |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
12 if hasattr(component, "step"): |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
13 component.step(dt) |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
14 for system in self.systems: |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
15 if hasattr(system, "step"): |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
16 system.step(dt) |