Background
Generating a tile is expensive and the same tile gets asked for more than once as the user moves around, so finished grids are kept rather than thrown away. This is a separate job from the sum and weight grids, which are scratch space that only lives as long as one region is being built.
Description
Create a function to put a finished grid in under a tile seed and one to get it back out, returning nothing if that tile has not been generated yet.
A tile is identified by its seed, which already has the coordinate worked into it, so two different worlds cannot collide.
Testing:
- Assert a tile that was put in comes back out unchanged
- Assert asking for a tile that was never put in returns nothing
- Assert two different tile seeds do not overwrite each other
Background
Generating a tile is expensive and the same tile gets asked for more than once as the user moves around, so finished grids are kept rather than thrown away. This is a separate job from the sum and weight grids, which are scratch space that only lives as long as one region is being built.
Description
Create a function to put a finished grid in under a tile seed and one to get it back out, returning nothing if that tile has not been generated yet.
A tile is identified by its seed, which already has the coordinate worked into it, so two different worlds cannot collide.
Testing: