Skip to content

Expand a request up to a whole number of windows #66

Open

Description

@KurbyDoo

Background

Terrain is generated by laying windows over a region, so a region has to be a whole number of windows across. A request for any other size cannot be generated as it stands.

Description

Work out, from what was asked for, the region that will actually be generated. It is the smallest region that covers the request and is a whole number of windows on each side.

The expanded region sits on the same world grid the windows do, so expanding a request does not shift where its terrain comes from. Asking for the same area twice must expand to the same region both times.

Testing:

  • Assert a request that is already a whole number of windows is left as it is
  • Assert a request smaller than a single window expands to one window
  • Assert a request that is not a whole number of windows expands to the next whole number on each side
  • Assert the expanded region covers every cell that was asked for
  • Assert the same request expands to the same region every time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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