CacheProvider constructor
CacheProvider({
- required int width,
- required int height,
- required NoisePlane generator,
- CacheCoordinatePlane coordinatePlane = CacheCoordinatePlane.normal,
- bool lazy = false,
- double? initialValue,
Implementation
CacheProvider({
required int width,
required int height,
required NoisePlane generator,
CacheCoordinatePlane coordinatePlane = CacheCoordinatePlane.normal,
bool lazy = false,
double? initialValue,
}) {
cache = DoubleArrayCacheProvider(
width: width,
height: height,
provider: this,
initialValue: initialValue,
coordinatePlane: coordinatePlane);
if (!lazy) {
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
cache.set(x, y, generator.noise2(x.toDouble(), y.toDouble()));
}
}
}
}