Mercurial > parpg-source
annotate mode.py @ 13:bf165b30254f
Added dict and list as possible component field types
author | KarstenBock@gmx.net |
---|---|
date | Sun, 31 Jul 2011 21:53:38 +0200 |
parents | e0477f8983cb |
children | 7b31de1dc964 |
rev | line source |
---|---|
5 | 1 |
8
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
2 from parpg.grease.mode import * |
5 | 3 from fife.extensions.basicapplication import ApplicationBase |
4 import abc | |
5 | |
6 class FifeManager(BaseManager, ApplicationBase): | |
7 | |
8 def __init__(self, TDS): | |
9 ApplicationBase.__init__(self, TDS) | |
10 self.modes = [] | |
11 | |
12 def _pump(self): | |
13 if self.current_mode: | |
10
e0477f8983cb
Supply the correct value for TimeDelta now
KarstenBock@gmx.net
parents:
9
diff
changeset
|
14 self.current_mode.pump(self.engine.getTimeManager().getTimeDelta() / 1000.0) |
5 | 15 |
16 class FifeMode(BaseMode): | |
17 | |
8
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
18 def __init__(self): |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
19 BaseMode.__init__(self) |
708a6f651c31
Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents:
5
diff
changeset
|
20 |
5 | 21 @abc.abstractmethod |
22 def pump(self, dt): | |
23 """Performs actions every frame""" |