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.
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.