# HG changeset patch # User KarstenBock@gmx.net # Date 1315146323 -7200 # Node ID bcabbffc88e69ebd744acc15d0147c9d3d5af331 # Parent 59a4337f328feae97c87b068478d4a802ec68a23 Move setup_behaviour method of the Character entity to a function in fifeagent.py diff -r 59a4337f328f -r bcabbffc88e6 components/fifeagent.py --- a/components/fifeagent.py Sun Sep 04 15:19:47 2011 +0200 +++ b/components/fifeagent.py Sun Sep 04 16:25:23 2011 +0200 @@ -19,3 +19,9 @@ def __init__(self): """Constructor""" Component.__init__(self, identifier=int, layer=object, behaviour=object, gfx=str) + + +def setup_behaviour(agent): + """Attach the behaviour to the layer""" + if agent.behaviour: + agent.behaviour.attachToLayer(agent.identifier) \ No newline at end of file diff -r 59a4337f328f -r bcabbffc88e6 entities/character.py --- a/entities/character.py Sun Sep 04 15:19:47 2011 +0200 +++ b/entities/character.py Sun Sep 04 16:25:23 2011 +0200 @@ -30,8 +30,3 @@ self.fifeagent.layer = layer self.fifeagent.behaviour = behaviour self.fifeagent.gfx = gfx - - def setup_behaviour(self): - """Attach the behaviour to the layer""" - if self.fifeagent.behaviour: - self.fifeagent.behaviour.attachToLayer(self.fifeagent.identifier)