# HG changeset patch # User KarstenBock@gmx.net # Date 1312148934 -7200 # Node ID 9ffcb493a0f4ce6bace7ee6b7b5df8780f3d536a # Parent a9019d0ac5f87be045d085245a2ba6d9756a3743 Changes for the container system diff -r a9019d0ac5f8 -r 9ffcb493a0f4 components/containable.py --- a/components/containable.py Sun Jul 31 23:47:28 2011 +0200 +++ b/components/containable.py Sun Jul 31 23:48:54 2011 +0200 @@ -18,4 +18,7 @@ def __init__(self): """Constructor""" - Component.__init__(bulk=int, weight=int, image=str, container=object) + Component.__init__(bulk=int, weight=int, image=str, current_container=object, new_container=object, new_slot=int) + self.fields['current_container'].default = None + self.fields['new_container'].default = None + self.fields['new_slot'].default = -1 diff -r a9019d0ac5f8 -r 9ffcb493a0f4 components/container.py --- a/components/container.py Sun Jul 31 23:47:28 2011 +0200 +++ b/components/container.py Sun Jul 31 23:48:54 2011 +0200 @@ -20,3 +20,9 @@ def __init__(self): Component.__init__(children=list, max_bulk=int) + +def get_bulk(container): + bulk = 0 + for child in container.children: + bulk += child.bulk + return bulk