annotate mode.py @ 5:bc88f7d5ca8b

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