diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-03-17 04:34:39 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-03-17 04:34:39 (GMT) |
commit | 204dea30c4f6607168be302bd481b04b640f09d0 (patch) | |
tree | cfde073673c82b096cefa86a79ba7be25eb79531 /model.py | |
parent | f375c2d319a8c8cc05b389100280249f1cb53ed9 (diff) |
Add a unique id_resource property to the resources.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'model.py')
-rw-r--r-- | model.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -26,9 +26,14 @@ class GameModel: 'file_image' = '' 'file_text' = ''} """ + self.data['last_resource_id'] = 0 self.data['map_data'] = None + def get_new_resource_id(self): + self.data['last_resource_id'] = self.data['last_resource_id'] + 1 + return self.data['last_resource_id'] + def write(self, file_name): instance_path = os.path.join(activity.get_activity_root(), 'instance') |