view world.py @ 57:ba85e5aff370

Removed the pos value from the fifeagent component. getItemActions of Gamescenecontroller gets the position by calling a method of the behaviour.
author KarstenBock@gmx.net
date Fri, 09 Sep 2011 15:30:23 +0200
parents d3a9caba067b
children e2004c9549d7
line wrap: on
line source

from bGrease.world import *
from bGrease.component import Component

from parpg.mode import FifeMode
from parpg import components

class World(FifeMode, BaseWorld):

    def __init__(self):
        FifeMode.__init__(self)
        BaseWorld.__init__(self)
        
    def configure(self):
        """Configure the game world's components, systems and renderers"""
        self.components.characterstats = components.CharacterStatistics()
        self.components.containable = components.Containable()
        self.components.container = components.Container()
        self.components.description = components.Description()
        self.components.dialogue = components.Dialogue()
        self.components.fifeagent = components.FifeAgent()
        self.components.lockable = components.Lockable()
        self.components.usable = components.Usable()
        
        #WORKAROUND: To get rid of exception in gamescenecontroller
        self.components.change_map = Component()
    
    def pump(self, dt):
        for component in self.components:
            if hasattr(component, "step"):
                component.step(dt)
        for system in self.systems:
            if hasattr(system, "step"):
                system.step(dt)