Mercurial > parpg-core
view src/parpg/world.py @ 63:b15cf999216a
Added components to the World class
author | KarstenBock@gmx.net |
---|---|
date | Mon, 05 Sep 2011 14:46:43 +0200 |
parents | 94cb5843dcbb |
children | 96af64cf3b81 |
line wrap: on
line source
from parpg.grease.world import * 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.behaviour = components.Behavior() self.components.characterstats = components.CharacterStatistics() self.components.containable = components.Containable() self.components.container = components.Container() self.components.description = components.Description() self.components.dialog = components.Dialog() self.components.fifeagent = components.FifeAgent() self.components.lockable = components.Lockable() self.components.usable = components.Usable() 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)