package projectzombie.worker;

import java.util.Random;
import java.util.Vector;

import gl_engine.vec.Vec2i;
import projectzombie.world.chunk.Chunk;
import projectzombie.world.layer.Layer;
import projectzombie.world.layer.layergen.LayerGen;

class WorkerTaskChunkGenerate extends WorkerTaskChunk
{
	Chunk chunk;
	LayerGen layergen;
	Layer layer;
	Random rand;
	
	public WorkerTaskChunkGenerate(LayerGen layergen, Layer layer, Chunk chunk, Random rand, Vec2i pos) {
		this.chunk = chunk;
		this.layergen = layergen;
		this.layer = layer;
		this.rand = rand;
		this.pos = pos;
	}
	
	@Override
	public void run()
	{
		layergen.generateChunk(chunk, layer, rand, pos);
		
		WorkerTasks.addChunkOut(chunk);
	}
}
