annotate world.py @ 58:d4f213b99d41

Added meet and met methods from the old player object to the gamestate.
author KarstenBock@gmx.net
date Fri, 09 Sep 2011 15:47:43 +0200
parents d3a9caba067b
children e2004c9549d7
rev   line source
41
ff3e395abf91 Renamed grease to bGrease (Basic Grease) to get rid of conflicts with an already installed grease.
KarstenBock@gmx.net
parents: 38
diff changeset
1 from bGrease.world import *
51
d3a9caba067b Modifications to make talking with npcs possible again. Special actions won't work yet though.
KarstenBock@gmx.net
parents: 49
diff changeset
2 from bGrease.component import Component
38
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
3
8
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
4 from parpg.mode import FifeMode
38
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
5 from parpg import components
5
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
6
8
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
7 class World(FifeMode, BaseWorld):
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
8
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
9 def __init__(self):
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
10 FifeMode.__init__(self)
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
11 BaseWorld.__init__(self)
38
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
12
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
13 def configure(self):
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
14 """Configure the game world's components, systems and renderers"""
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
15 self.components.characterstats = components.CharacterStatistics()
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
16 self.components.containable = components.Containable()
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
17 self.components.container = components.Container()
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
18 self.components.description = components.Description()
42
66a06de1bddc Renamed dialog to dialogue
KarstenBock@gmx.net
parents: 41
diff changeset
19 self.components.dialogue = components.Dialogue()
38
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
20 self.components.fifeagent = components.FifeAgent()
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
21 self.components.lockable = components.Lockable()
b30a72c41f90 Added components to the World class
KarstenBock@gmx.net
parents: 8
diff changeset
22 self.components.usable = components.Usable()
51
d3a9caba067b Modifications to make talking with npcs possible again. Special actions won't work yet though.
KarstenBock@gmx.net
parents: 49
diff changeset
23
d3a9caba067b Modifications to make talking with npcs possible again. Special actions won't work yet though.
KarstenBock@gmx.net
parents: 49
diff changeset
24 #WORKAROUND: To get rid of exception in gamescenecontroller
d3a9caba067b Modifications to make talking with npcs possible again. Special actions won't work yet though.
KarstenBock@gmx.net
parents: 49
diff changeset
25 self.components.change_map = Component()
5
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
26
bc88f7d5ca8b Added base files for grease
KarstenBock@gmx.net
parents:
diff changeset
27 def pump(self, dt):
8
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
28 for component in self.components:
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
29 if hasattr(component, "step"):
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
30 component.step(dt)
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
31 for system in self.systems:
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
32 if hasattr(system, "step"):
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
33 system.step(dt)