Mercurial > parpg-source
annotate world.py @ 24:eab8af30dfc7
get_free_slot no raises an exception instead of appending a slot to the container.
author | KarstenBock@gmx.net |
---|---|
date | Fri, 02 Sep 2011 12:54:43 +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) |