-
Notifications
You must be signed in to change notification settings - Fork 23
2D Coordinate Type #103
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
2D Coordinate Type #103
Conversation
|
Also, something like a auto c1 = Coordinate2D(0, 0);
auto c2 = Coordinate2D(100, 100);
auto chunk = mc.getBlocks(c1.filled(), c2.filled());where each |
How could it do this without accessing the I suppose Perhaps Coordinate2D c1{0, 0};
Coordinate2D c2{100, 100};
Chunk chunk = mc.getBlocks(
mc.withHeight(c1),
mc.withHeight(c2)
);Although this doesn't read as nice (grammatically), so Note that Alternatively, |
|
I think |
|
Ah, my bad. Didn't think through that dependency properly. Your suggestion sounds good (with snake case though). |
rozukke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Hopefully this is a step towards reducing ambiguity in the existing api
|
|
Introduces a new '2D coordinate' struct which mirrors the existing
Coordinatestruct, but does not contain ayvalue.Adds constructors to (often implicitly) convert between
CoordinateandCoordinate2D.Replaces some parameters and return values with
Coordinate2Din relevant functions (getHeightandgetHeightsinMinecraftConnection,get_worldspaceandbase_ptin `HeightMap).Possible changes:
Coordinate2(mirrors naming style for other libraries, eg.Vec2,float3). Likely not ideal sinceCoordinatekeeps the same name regardless.Coordinate2.Note that overloading function parameters such as
MinecraftConnection::getHeightto accept aCoordinateis unnecessary, since aCoordinatewill be implicitly cast to aCoordinate2in such a context.