Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/game.py
diff options
context:
space:
mode:
Diffstat (limited to 'game.py')
-rw-r--r--game.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/game.py b/game.py
index c5e54d1..9d21b4b 100644
--- a/game.py
+++ b/game.py
@@ -57,7 +57,7 @@ class MemorizeGame(GObject):
'change-turn': (SIGNAL_RUN_FIRST, None, [TYPE_PYOBJECT]),
}
- def __init__(self):
+ def __init__(self, activity_instance):
gobject.GObject.__init__(self)
self.myself = None
self.players_score = {}
@@ -70,7 +70,7 @@ class MemorizeGame(GObject):
self.messenger = None
self.sentitive = True
- self.model = Model()
+ self.model = Model(activity_instance=activity_instance)
self.flip_block = False
self._flop_cards = None
@@ -109,6 +109,16 @@ class MemorizeGame(GObject):
self.change_turn()
self.model.data['running'] = 'False'
+ # Card 'state' is an aawesome field.
+ # Its takes on the following values ::
+ #
+ # 0 ==> for flopped cards.
+ #
+ # 1 ==> for flipped unmatched cards
+ # (can be a maximum of 1 such card).
+ #
+ # <stroke_color>, <fill_color> ==> for flipped matched cards
+
for card in self.model.grid:
if card['state'] == '1':
self.emit('flip-card', self.model.grid.index(card), False)