Skip to content

Return a tile that has already been generated instead of running it again #39

Description

@KurbyDoo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions