Background
Generating a tile is expensive and the visualizer will ask for the same tile more than once as the user moves around.
Description
Before generating, ask #31 whether it already holds a finished grid for this tile seed and return that if it does. Otherwise generate it, put it in the store, then return it.
A tile is identified by its seed, which already has the coordinate worked into it. Two different global seeds are two different worlds and must never share a tile.
Testing:
- Assert asking for the same tile twice only runs the sampler once
- Assert the second call returns the same grid as the first
- Assert the same coordinate under a different global seed runs the sampler again
Background
Generating a tile is expensive and the visualizer will ask for the same tile more than once as the user moves around.
Description
Before generating, ask #31 whether it already holds a finished grid for this tile seed and return that if it does. Otherwise generate it, put it in the store, then return it.
A tile is identified by its seed, which already has the coordinate worked into it. Two different global seeds are two different worlds and must never share a tile.
Testing: