Skip to content

Conversation

@Bumber64
Copy link
Contributor

@Bumber64 Bumber64 commented Jun 5, 2024

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_type enum attrs, since we're removing the cuboid struct from plugins/plant.cpp in this PR anyway.

@Bumber64
Copy link
Contributor Author

Bumber64 commented Jun 5, 2024

Need to apply this to existing functions (e.g., Units::isUnitInBox and Units::getUnitsInBox, as well as plugins that iterate map tiles).

@Bumber64
Copy link
Contributor Author

Bumber64 commented Jun 7, 2024

Should a class with only public members more properly be a struct, or is it weirder to have a struct with member functions?

@myk002
Copy link
Member

myk002 commented Jun 7, 2024

Should a class with only public members more properly be a struct, or is it weirder to have a struct with member functions?

I don't have an opinion one way or the other here. I'd say do whatever feels natural.

@Bumber64 Bumber64 reopened this Jun 8, 2024
@myk002 myk002 merged commit 2ba4855 into DFHack:develop Jun 9, 2024
@Bumber64 Bumber64 deleted the cuboid branch June 9, 2024 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

coordRange df::coord iterator for Maps module Cuboid struct/class for df::coord bounds

2 participants