view mode.py @ 183:7b6aba7839ea

getGameEnvironment of GameState now returns a locals dictionary that is empty at the beginning of the game and will be saved in save games. The vals and funcs are now both in the globals dictionary. This WILL break old saves.
author Beliar <KarstenBock@gmx.net>
date Thu, 15 Mar 2012 16:24:05 +0100
parents e856b604b650
children
line wrap: on
line source


from parpg.bGrease.mode import *
import abc

class FifeManager(BaseManager):

        def __init__(self):
                self.modes = []

        def _pump(self):
                if self.current_mode:
                        self.current_mode.pump(self.current_mode.engine.getTimeManager().getTimeDelta() / 1000.0)

class FifeMode(BaseMode):

        def __init__(self):
                BaseMode.__init__(self)

        @abc.abstractmethod
        def pump(self, dt):
                """Performs actions every frame"""