Skip to content

Level should be size-aware #275

@ForNeVeR

Description

@ForNeVeR

See the code near this line:

// TODO: Pick the actual level size instead of hardcoding here. In the future, we might wish to have levels
// of different sizes in the same game. This will require the level to be aware of its size, though.

Currently, our Level is not size-aware: it's just a jagged array of cells. For some purposes (such as the linked one), we need to know the level size. We can either hardcode it (use same size from GameRules for every level), or calculate it in-place, but both approaches are suboptimal.

If in the future we'll want to have levels of different sizes (say for boss battles, custom mods or whatnot), hardcode will stop fitting us.

So, let's make the Level type to be aware of its own size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions