Skip to content

Hold finished tiles and hand them back by seed #44

Description

@KurbyDoo

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

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