# HG changeset patch # User KarstenBock@gmx.net # Date 1317130704 -7200 # Node ID d2451ecb14334ee319740dfed6b4495d21829731 # Parent 4a8a0cd7f79a8e032f2bd98a2e453b4ecb530743 Added saveable_fields to FifeAgent component. diff -r 4a8a0cd7f79a -r d2451ecb1433 components/fifeagent.py --- a/components/fifeagent.py Tue Sep 27 15:23:43 2011 +0200 +++ b/components/fifeagent.py Tue Sep 27 15:38:24 2011 +0200 @@ -11,8 +11,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +from copy import deepcopy + from base import Base + class FifeAgent(Base): """Component that stores the values for a fife agent""" @@ -20,6 +23,13 @@ """Constructor""" Base.__init__(self, layer=object, behaviour=object, gfx=str) + @property + def saveable_fields(self): + fields = deepcopy(self.fields) + del fields["layer"] + del fields["behaviour"] + return fields + def setup_behaviour(agent): """Attach the behaviour to the layer"""