annotate world.py @ 69:c1959525efda

Added get_equipable and take_equipable functions.
author KarstenBock@gmx.net
date Wed, 21 Sep 2011 17:32:36 +0200
parents 8915ff6183b0
children a9cc5559ec2a
rev   line source
65
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
1 from parpg.bGrease.world import *
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
2 from parpg.bGrease.component import Component
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
3
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
4 from parpg.mode import FifeMode
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
5 from parpg import components
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
6
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
7 class World(FifeMode, BaseWorld):
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
8
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
9 def __init__(self):
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
10 FifeMode.__init__(self)
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
11 BaseWorld.__init__(self)
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
12
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
13 def configure(self):
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
14 """Configure the game world's components, systems and renderers"""
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
15 self.components.characterstats = components.CharacterStatistics()
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
16 self.components.containable = components.Containable()
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
17 self.components.container = components.Container()
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
18 self.components.description = components.Description()
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
19 self.components.dialogue = components.Dialogue()
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
20 self.components.fifeagent = components.FifeAgent()
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
21 self.components.lockable = components.Lockable()
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
22 self.components.usable = components.Usable()
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
23 self.components.change_map = components.ChangeMap()
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
24 self.components.equipable = components.Equipable()
68
8915ff6183b0 Added equip to the usable components of the World class.
KarstenBock@gmx.net
parents: 65
diff changeset
25 self.components.equip = components.Equip()
65
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
26
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
27 def pump(self, dt):
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
28 for component in self.components:
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
29 if hasattr(component, "step"):
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
30 component.step(dt)
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
31 for system in self.systems:
e856b604b650 Changed "import bGrease" to "import parpg.bGrease".
KarstenBock@gmx.net
parents: 63
diff changeset
32 if hasattr(system, "step"):
8
708a6f651c31 Modifications to use the grease manager and modes
KarstenBock@gmx.net
parents: 5
diff changeset
33 system.step(dt)