Implement df::coord iterator and cuboid class #4675
Merged
myk002 merged 7 commits intoDFHack:developfrom Jun 9, 2024
Merged
Conversation
Contributor
Author
|
Need to apply this to existing functions (e.g., |
myk002
reviewed
Jun 6, 2024
Contributor
Author
|
Should a class with only public members more properly be a struct, or is it weirder to have a struct with member functions? |
Member
I don't have an opinion one way or the other here. I'd say do whatever feels natural. |
myk002
approved these changes
Jun 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement an iterator that operates on all
df::coords within a cuboid box. Iterates in the direction of x/y/z provided (rather than always min to max.) By default iterates per z-level, but has an option to iterate in the z direction first.Closes #4596
Cuboid class for defining a cuboid of tiles. Can test if a coord is inside itself. Can be expanded to contain a given coord. Has a method to call the above iterator using the defined cuboid.
Closes #4595
Also update plugins to use
plant_typeenum attrs, since we're removing thecuboidstruct fromplugins/plant.cppin this PR anyway.