for(int i=0;i<numLayers;i++) { TileLayer tl = (TileLayer) mp.getLayer(initLayer - i); if(tl != null) { for(int cy = 0; cy <= bounds.height; cy++) { for(int cx = 0; cx < bounds.width; cx++) { if(shape.contains(cx, cy) && (mt.genrand() % 101) <= (100*ratio) ) { tl.setTileAt(cx+centerx, cy+centery, paintTile); } } } } }
    public Rectangle commitPaint(MultilayerPlane mp, int x, int y, int start) {        Rectangle bounds = shape.getBounds();        int centerx = (int)(x - (bounds.width / 2));        int centery = (int)(y - (bounds.height / 2));                //TODO: use the Mersenne Twister to randomize painting the specified tile                return new Rectangle(centerx, centery, bounds.width, bounds.height);    }