CacheProvider method

dynamic CacheProvider({
  1. required int width,
  2. required int height,
  3. required NoisePlane generator,
})

Implementation

CacheProvider(
    {required int width,
    required int height,
    required NoisePlane generator}) {
  cache = MirroredDoubleCache(width: width, height: height);
  for (int x = 0; x < width; x++) {
    for (int y = 0; y < height; y++) {
      cache.set(x, y, generator.noise2(x.toDouble(), y.toDouble()));
    }
  }
}