annotate mode.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 7b31de1dc964
children 86799b61e5dc
rev   line source
5
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
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
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
3 import abc
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
4
17
7b31de1dc964 FifeManager no longer subclasses ApplicationBase
KarstenBock@gmx.net
parents: 10
diff changeset
5 class FifeManager(BaseManager):
5
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
6
17
7b31de1dc964 FifeManager no longer subclasses ApplicationBase
KarstenBock@gmx.net
parents: 10
diff changeset
7 def __init__(self):
5
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
8 self.modes = []
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
9
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
10 def _pump(self):
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
11 if self.current_mode:
10
e0477f8983cb Supply the correct value for TimeDelta now
KarstenBock@gmx.net
parents: 9
diff changeset
12 self.current_mode.pump(self.engine.getTimeManager().getTimeDelta() / 1000.0)
5
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
13
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
14 class FifeMode(BaseMode):
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
15
8
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
16 def __init__(self):
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
17 BaseMode.__init__(self)
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
18
5
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"""