annotate src/parpg/mode.py @ 27:09b581087d68

Added base files for grease
author KarstenBock@gmx.net
date Tue, 12 Jul 2011 10:16:48 +0200
parents
children 94cb5843dcbb
rev   line source
27
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
1
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
2 from grease.mode import *
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
3 from fife.extensions.basicapplication import ApplicationBase
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
4 import abc
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
5
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
6 class FifeManager(BaseManager, ApplicationBase):
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
7
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
8 def __init__(self, TDS):
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
9 ApplicationBase.__init__(self, TDS)
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
10 self.modes = []
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
11 self._settings = TDS
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
12
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
13 def _pump(self):
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
14 if self.current_mode:
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
15 self.current_mode.pump(self.engine.getTimeManager().getTimeDelta() / 1000)
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
16
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
17 class FifeMode(BaseMode):
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
18
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
19 @abc.abstractmethod
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
20 def pump(self, dt):
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
21 """Performs actions every frame"""