Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Chunk, HeightMap iterators to work when const #106

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

dxrcy
Copy link
Contributor

@dxrcy dxrcy commented Dec 3, 2024

Creates const versions of iterators for both Chunk and HeightMap.
Adds const overloads for begin and end methods for both structures.

Example usage:
The chunk variable in the following code snippet can now be marked const, without the for loop complaining.

    const Chunk chunk = mc.getBlocks(start, end);
    for (BlockType block : chunk) {
        //
    }

This should not be a breaking change; existing methods and iterator types remain the same.

@dxrcy dxrcy marked this pull request as ready for review December 3, 2024 08:42
Copy link
Owner

@rozukke rozukke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ready to pull in after this functionality has test coverage.

@dxrcy
Copy link
Contributor Author

dxrcy commented Dec 5, 2024

Should be ready to pull in after this functionality has test coverage.

How foolish of me to forget.

Copy link
Owner

@rozukke rozukke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@rozukke rozukke merged commit 01cde33 into rozukke:main Dec 10, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants