summaryrefslogtreecommitdiff
path: root/host/simu/view
diff options
context:
space:
mode:
authorNicolas Schodet2011-05-15 22:44:20 +0200
committerNicolas Schodet2011-05-15 22:44:20 +0200
commit201aa07cbd28c6be8c4003f126b1ae258f859c68 (patch)
tree1f38db503d0fc063b6d82fbe45aa003a86ce0ba2 /host/simu/view
parent73f25d3310706c5d7a559f120805c54860b16795 (diff)
host/simu: handle dropping tower on the table
Diffstat (limited to 'host/simu/view')
-rw-r--r--host/simu/view/table_eurobot2011.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/host/simu/view/table_eurobot2011.py b/host/simu/view/table_eurobot2011.py
index 5725e5b8..b39f2834 100644
--- a/host/simu/view/table_eurobot2011.py
+++ b/host/simu/view/table_eurobot2011.py
@@ -76,8 +76,13 @@ class Table (Drawable):
def __init__ (self, onto, model):
Drawable.__init__ (self, onto)
self.model = model
- for e in model.pawns:
- Pawn (self, e)
+ self.model.register (self.__notified)
+ self.__notified ()
+
+ def __notified (self):
+ for e in self.model.pawns:
+ if e not in self.children:
+ Pawn (self, e)
def draw_both (self, primitive, *args, **kargs):
"""Draw a primitive on both sides."""