I am currently coding a ‘world generator’ which uses a job for each chunk of the world. I would like to pass a class to the job which is used to generate noise height-maps. The problem is that the class has a tree structure using arrays for child classes, arrays being ‘managed’:
class Noise
{
int seed;
NoiseLayer[] layers;
public float GetNoise();
}
class NoiseLayer
{
/* Noise Layer Settings */
NoiseLayer[] layers;
public float GetNoise();
}
Its the ‘Noise’ class which I would like to pass to each job.
So, my question is: Is their a way I can give the jobs access to the class instance, either directly or indirectly?