@Override
	public void update()
	{
		sea_level_ = map_.getSeaLevel();
		remainder_ = 1.0f - sea_level_;
		
		Map<WorldGenerationCell> map = map_.getMap();
		
		int width = map.getWidth();
		int height = map.getHeight();
		
		// init rainfall
		
		rainfall_ = new float[width][height];
		
		for(int y = 0; y < height; y++)
		{
			rainfall_[0][y] = getInitRainfall(0, y);
			rainfall_[width - 1][y] = getInitRainfall(width - 1, y);
		}
		
		for(int x = 0; x < width; x++)
		{
			rainfall_[x][0] = getInitRainfall(x, 0);
			rainfall_[x][height - 1] = getInitRainfall(x, height - 1);
		}
		
		// right & up
		
		for(int y = 1; y < height; y++)
		{
			for(int x = 1; x < width; x++)
			{
				float water_left = rainfall_[x-1][y];
				float water_down = rainfall_[x][y-1];
				float water_diagonal = rainfall_[x-1][y-1];
				float water = Math.max(water_diagonal, Math.max(water_left, water_down));
				
				updateCell(x, y, water);
			}
		}
		
		// left & down
		
		for(int y = height - 2; y >= 0; y--)
		{
			for(int x = width - 2; x >= 0; x--)
			{
				float water_right = rainfall_[x+1][y];
				float water_up = rainfall_[x][y+1];
				float water_diagonal = rainfall_[x+1][y+1];
				float water = Math.max(water_diagonal, Math.max(water_right, water_up));
				
				updateCell(x, y, water);
			}
		}
	}