Remove debugging prints. Add get_data method for saving
authorNeil <neil@dip.sun.ac.za>
Thu, 18 Apr 2013 11:55:13 +0000 (13:55 +0200)
committerNeil <neil@dip.sun.ac.za>
Thu, 18 Apr 2013 11:55:13 +0000 (13:55 +0200)
erdslangetjie/level.py

index 73878aa927bf438439d6b6c08d06dabf2b021a25..4f8059e5383d65add9a62b436c0426874ecdcabe 100644 (file)
@@ -93,11 +93,7 @@ class Level(object):
         return self._data[pos[1]][pos[0]]
 
     def set_tile_type(self, pos, new_type):
-        print '\n'.join([''.join(x) for x in self._data])
         self._data[pos[1]][pos[0]] = new_type
-        print
-        print '\n'.join([''.join(x) for x in self._data])
-        print pos, self._in_limits(pos)
         new_tile = self._get_tile_image(pos, new_type)
         self._tiles[pos[1]][pos[0]] = new_tile
         self._changed.append((pos, new_tile))
@@ -109,7 +105,6 @@ class Level(object):
             if not self._in_limits(new_pos):
                 continue
             tile = self._data[new_pos[1]][new_pos[0]]
-            print new_pos, tile
             new_tile = self._get_tile_image(new_pos, tile)
             self._tiles[new_pos[1]][new_pos[0]] = new_tile
             self._changed.append((new_pos, new_tile))
@@ -120,6 +115,9 @@ class Level(object):
     def at_exit(self, pos):
         return pos in self.exit_pos
 
+    def get_level_data(self):
+        return '\n'.join(reversed([''.join(x) for x in self._data]))
+
     def _get_wall_tile(self, pos):
         # Is the neighbour in this direction also a wall?
         x, y = pos