changeset 42:9a97f53fc550

Backed out changeset: 6a637c737d20
author KarstenBock@gmx.net
date Wed, 10 Aug 2011 21:08:48 +0200
parents 74f09d6417f4
children 1cc037593517
files src/parpg/systems/container.py
diffstat 1 files changed, 0 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/src/parpg/systems/container.py	Wed Aug 10 21:08:14 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#   This program is free software: you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation, either version 3 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#   GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-from parpg.grease import System
-from parpg.components import container
-
-class Container(System):
-    """System that controls changes to containers"""
-
-    def __init__(self, drag_container,
-                 container_component="container", 
-                 containable_component="containable"
-                 ):
-        """Constructor"""
-        self.drag_container = drag_container
-        self.container_component = container_component
-        self.containable_component = containable_component
-        self.on_bulk_to_big = []
-        
-    def step(self, dt):
-        """Perform changes to containers and items"""
-        assert self.world is not None, "Cannot run with no world set"
-        for containable in self.world.components.join(
-            self.containable_component
-            ):
-            if containable.new_container:
-                new_container = containable.new_container
-                new_slot = containable.new_slot
-                bulk_add = containable.bulk
-                if new_slot >= 0 and new_slot < len(new_container.children):
-                    bulk_add -= new_container.children[new_slot].bulk
-                elif new_slot >= len(new_container.children):
-                    new_slot = -1
-                bulk = get_bulk(new_container) + bulk_add
-                if bulk < new_container.max_bulk:
-                    if new_slot >= 0:
-                        new_container.children.insert(new_slot + 1, containable)
-                        containable.current_container = new_container
-                        old_containable = new_container.children.pop(new_slot)
-                        old_containable.current_container = drag_container
-                        drag_container.children = [old_containable]
-                else:
-                    for listener in self.on_bulk_to_big:
-                        listener(bulk, new_container.max_bulk)
-                        
-                
\ No newline at end of file