<s> import math <EOL> import meshManager <EOL> class GridFactory ( meshManager . MeshFactory ) : <EOL> def __init__ ( self , scalar , gridSize ) : <EOL> self . scalar = scalar <EOL> self . gridSize = gridSize <EOL> meshManager . MeshFactory . __init__ ( self ) <EOL> def draw ( self , drawResourcesFactories , x0 , y0 , x1 , y1 , tileCenter , collision ) : <EOL> for LOD , drawResourcesFactory in drawResourcesFactories . iteritems ( ) : <EOL> tile = drawResourcesFactory . getTile ( ) <EOL> grid = self . gridSize * self . scalar <EOL> x = math . ceil ( x0 / grid ) * grid <EOL> while x < x1 : <EOL> y = math . ceil ( y0 / grid ) * grid <EOL> while y < y1 : <EOL> self . drawItem ( LOD , x , y , drawResourcesFactory , tile , tileCenter , collision ) <EOL> y += grid <EOL> x += grid <EOL> class GridFactory2 ( meshManager . MeshFactory ) : <EOL> def __init__ ( self , scalar , gridSize ) : <EOL> self . scalar = scalar <EOL> self . gridSize = gridSize <EOL> meshManager . MeshFactory . __init__ ( self ) <EOL> def draw ( self , drawResourcesFactories , x0 , y0 , x1 , y1 , tileCenter , collision ) : <EOL> grid = self . gridSize * self . scalar <EOL> x = math . ceil ( x0 / grid ) * grid <EOL> while x < x1 : <EOL> y = math . ceil ( y0 / grid ) * grid <EOL> while y < y1 : <EOL> self . drawItem ( drawResourcesFactories , x , y , tileCenter , collision ) <EOL> y += grid <EOL> x += grid </s>
