From 201aa07cbd28c6be8c4003f126b1ae258f859c68 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 15 May 2011 22:44:20 +0200 Subject: host/simu: handle dropping tower on the table --- host/simu/view/table_eurobot2011.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'host/simu/view') 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.""" -- cgit v1.2.3