annotate src/parpg/mode.py @ 39:8b3890f17f94

FifeManager no longer subclasses ApplicationBase PARPGApplication stores an instance of tbe manager instead
author KarstenBock@gmx.net
date Wed, 03 Aug 2011 22:57:52 +0200
parents 70738c470ad7
children 5e27c24acaef
rev   line source
27
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
1
30
94cb5843dcbb Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 27
diff changeset
2 from parpg.grease.mode import *
27
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
3 import abc
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
4
39
8b3890f17f94 FifeManager no longer subclasses ApplicationBase
KarstenBock@gmx.net
parents: 32
diff changeset
5 class FifeManager(BaseManager):
27
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
6
39
8b3890f17f94 FifeManager no longer subclasses ApplicationBase
KarstenBock@gmx.net
parents: 32
diff changeset
7 def __init__(self):
27
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
8 self.modes = []
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
9
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
10 def _pump(self):
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
11 if self.current_mode:
32
70738c470ad7 Supply the correct value for TimeDelta now
KarstenBock@gmx.net
parents: 31
diff changeset
12 self.current_mode.pump(self.engine.getTimeManager().getTimeDelta() / 1000.0)
27
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
13
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
14 class FifeMode(BaseMode):
09b581087d68 Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
15
30
94cb5843dcbb Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 27
diff changeset
16 def __init__(self):
94cb5843dcbb Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 27
diff changeset
17 BaseMode.__init__(self)
94cb5843dcbb Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 27
diff changeset
18
27
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"""