Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/model.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-05-01 07:03:00 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-05-01 07:03:00 (GMT)
commit8957651e74154850c9caddb36339d5abe3ad9538 (patch)
tree9b6ec18b188e3da665aa85cd4fbe5559d08a18aa /model.py
parent1dfcca8cf751ed78e81b8efa9e2d137dbd593826 (diff)
Add the StateView to the MapNavView in play mode
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'model.py')
-rw-r--r--model.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/model.py b/model.py
index daf4cf6..db55151 100644
--- a/model.py
+++ b/model.py
@@ -34,6 +34,12 @@ class GameModel:
self.data['map_data'] = None
+ state = {'displayed_questions': [],
+ 'replied_questions': [],
+ 'actions_log': []}
+
+ self.data['state'] = state
+
def get_new_resource_id(self):
self.data['last_resource_id'] = self.data['last_resource_id'] + 1
return self.data['last_resource_id']
@@ -42,6 +48,14 @@ class GameModel:
self.data['last_question_id'] = self.data['last_question_id'] + 1
return self.data['last_question_id']
+ def register_displayed_question(self, id_question):
+ if id_question not in self.data['state']['displayed_questions']:
+ self.data['state']['displayed_questions'].append(id_question)
+
+ def register_replied_question(self, id_question):
+ if id_question not in self.data['state']['replied_questions']:
+ self.data['state']['replied_questions'].append(id_question)
+
def get_resource(self, id_resource):
for resource in self.data['resources']:
if resource['id_resource'] == int(id_resource):