Mercurial > parpg-core
comparison src/parpg/components/container.py @ 93:0ea341301461
Fixed syntax error in container.py.
author | KarstenBock@gmx.net |
---|---|
date | Wed, 21 Sep 2011 16:11:06 +0200 |
parents | 0f659c7675f6 |
children | d456334d09c0 |
comparison
equal
deleted
inserted
replaced
92:0f659c7675f6 | 93:0ea341301461 |
---|---|
69 if type(slot_or_type) == int: | 69 if type(slot_or_type) == int: |
70 if len(container.children) >= (slot_or_type + 1): | 70 if len(container.children) >= (slot_or_type + 1): |
71 return container.children[slot_or_type] | 71 return container.children[slot_or_type] |
72 else: | 72 else: |
73 for item in container.children: | 73 for item in container.children: |
74 if child and if child.type == slot_or_type: | 74 if child and child.type == slot_or_type: |
75 return child | 75 return child |
76 | 76 |
77 return None | 77 return None |
78 | 78 |
79 def remove_item(container, slot_or_type): | 79 def remove_item(container, slot_or_type): |
84 container.children[slot_or_type] = None | 84 container.children[slot_or_type] = None |
85 item.container = None | 85 item.container = None |
86 item.slot = -1 | 86 item.slot = -1 |
87 else: | 87 else: |
88 for item in container.children: | 88 for item in container.children: |
89 if child and if child.type == slot_or_type: | 89 if child and child.type == slot_or_type: |
90 container.children[child.slot] = None | 90 container.children[child.slot] = None |
91 child.container = None | 91 child.container = None |
92 child.slot = -1 | 92 child.slot = -1 |
93 | 93 |
94 def take_item(container, slot_or_type): | 94 def take_item(container, slot_or_type): |