# HG changeset patch
# User KarstenBock@gmx.net
# Date 1317132307 -7200
# Node ID 0ab8b61a8a56a0c8e431cae10843f50644bc29b1
# Parent d2008d4972c1d94236a7da7cc4299656a0b5f56f
Added saveable_fields to containable, dialogue and equipable.
diff -r d2008d4972c1 -r 0ab8b61a8a56 src/parpg/components/containable.py
--- a/src/parpg/components/containable.py Tue Sep 27 15:57:36 2011 +0200
+++ b/src/parpg/components/containable.py Tue Sep 27 16:05:07 2011 +0200
@@ -11,6 +11,8 @@
# 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 Containable(Base):
@@ -19,3 +21,9 @@
def __init__(self):
"""Constructor"""
Base.__init__(self, bulk=int, weight=int, item_type=str, image=str, container=object, slot=int)
+
+ @property
+ def saveable_fields(self):
+ fields = deepcopy(self.fields)
+ del fields["container"]
+ return fields
\ No newline at end of file
diff -r d2008d4972c1 -r 0ab8b61a8a56 src/parpg/components/dialogue.py
--- a/src/parpg/components/dialogue.py Tue Sep 27 15:57:36 2011 +0200
+++ b/src/parpg/components/dialogue.py Tue Sep 27 16:05:07 2011 +0200
@@ -11,6 +11,8 @@
# 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 Dialogue(Base):
@@ -19,3 +21,9 @@
def __init__(self):
"""Constructor"""
Base.__init__(self, dialogue=object)
+
+ @property
+ def saveable_fields(self):
+ fields = deepcopy(self.fields)
+ del fields["dialogue"]
+ return fields
\ No newline at end of file
diff -r d2008d4972c1 -r 0ab8b61a8a56 src/parpg/components/equipable.py
--- a/src/parpg/components/equipable.py Tue Sep 27 15:57:36 2011 +0200
+++ b/src/parpg/components/equipable.py Tue Sep 27 16:05:07 2011 +0200
@@ -11,6 +11,8 @@
# 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 Equipable(Base):
@@ -19,4 +21,10 @@
"""
def __init__(self):
- Base.__init__(self, possible_slots=list, wearer=object, in_slot=str)
\ No newline at end of file
+ Base.__init__(self, possible_slots=list, wearer=object, in_slot=str)
+
+ @property
+ def saveable_fields(self):
+ fields = deepcopy(self.fields)
+ del fields["wearer"]
+ return fields
\ No newline at end of file