diff pytouhou/formats/std.py @ 15:07fba4e1da65

Refactor
author Thibaut Girka <thib@sitedethib.com>
date Fri, 05 Aug 2011 21:21:06 +0200
parents 58bc264aba38
children 6ebf9539c077
line wrap: on
line diff
--- a/pytouhou/formats/std.py
+++ b/pytouhou/formats/std.py
@@ -11,7 +11,8 @@ class Object(object):
 
 
 class Stage(object):
-    def __init__(self):
+    def __init__(self, num):
+        self.num = num
         self.name = ''
         self.bgms = (('', ''), ('', ''), ('', ''))
         self.objects = []
@@ -20,8 +21,8 @@ class Stage(object):
 
 
     @classmethod
-    def read(cls, file):
-        stage = Stage()
+    def read(cls, file, num):
+        stage = Stage(num)
 
         nb_objects, nb_faces = unpack('<HH', file.read(4))
         object_instances_offset, script_offset = unpack('<II', file.read(8))