summaryrefslogtreecommitdiff
path: root/host/simu/view
diff options
context:
space:
mode:
authorNicolas Schodet2013-04-24 22:44:30 +0200
committerNicolas Schodet2013-04-24 22:46:05 +0200
commit78d2f3d295c56e976c13b187b7723670411e4101 (patch)
tree4e973bbe34a6c67008429ad5d1a7771b351e5481 /host/simu/view
parente506888ef09a23440d71b3f59067afbe84259c40 (diff)
digital/io-hub/src/apbirthday, host/simu: add cherries cannon simulationHEADmaster
Diffstat (limited to 'host/simu/view')
-rw-r--r--host/simu/view/table_eurobot2013.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/host/simu/view/table_eurobot2013.py b/host/simu/view/table_eurobot2013.py
index 6acd847d..abb87906 100644
--- a/host/simu/view/table_eurobot2013.py
+++ b/host/simu/view/table_eurobot2013.py
@@ -90,6 +90,19 @@ class Plate (Drawable):
self.draw_circle (c.pos, c.radius, fill = colors[c.color])
Drawable.draw (self)
+class Cherries (Drawable):
+
+ def __init__ (self, onto, model):
+ Drawable.__init__ (self, onto)
+ self.model = model
+ self.model.register (self.update)
+
+ def draw (self):
+ self.reset ()
+ for c in self.model.cherries:
+ if c.pos:
+ self.draw_circle (c.pos, c.radius, fill = colors[c.color])
+
class Gift (Drawable):
def __init__ (self, onto, model):
@@ -122,6 +135,7 @@ class Table (Drawable):
Glass (self, e)
for e in self.model.plates:
Plate (self, e)
+ Cherries (self, self.model.cherries)
for e in self.model.gifts:
Gift (self, e)