comparison src/parpg/components/fifeagent.py @ 121:24edf5d53083

Added saveable_fields to FifeAgent component.
author KarstenBock@gmx.net
date Tue, 27 Sep 2011 15:38:24 +0200
parents 3564a46544bc
children d1364aeb61c6
comparison
equal deleted inserted replaced
120:1703dbb4fefb 121:24edf5d53083
9 # GNU General Public License for more details. 9 # GNU General Public License for more details.
10 # 10 #
11 # You should have received a copy of the GNU General Public License 11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>. 12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 13
14 from copy import deepcopy
15
14 from base import Base 16 from base import Base
17
15 18
16 class FifeAgent(Base): 19 class FifeAgent(Base):
17 """Component that stores the values for a fife agent""" 20 """Component that stores the values for a fife agent"""
18 21
19 def __init__(self): 22 def __init__(self):
20 """Constructor""" 23 """Constructor"""
21 Base.__init__(self, layer=object, behaviour=object, gfx=str) 24 Base.__init__(self, layer=object, behaviour=object, gfx=str)
22 25
26 @property
27 def saveable_fields(self):
28 fields = deepcopy(self.fields)
29 del fields["layer"]
30 del fields["behaviour"]
31 return fields
32
23 33
24 def setup_behaviour(agent): 34 def setup_behaviour(agent):
25 """Attach the behaviour to the layer""" 35 """Attach the behaviour to the layer"""
26 if agent.behaviour: 36 if agent.behaviour:
27 agent.behaviour.attachToLayer(agent.entity.getID(), agent.layer) 37 agent.behaviour.attachToLayer(agent.entity.getID(), agent.layer)