fix: no more compile warnings

This commit is contained in:
Martin Prokoph
2025-02-09 23:54:50 +01:00
parent 813e47a25e
commit 2b9a9b7781
15 changed files with 111 additions and 98 deletions

View File

@@ -6,12 +6,22 @@ public:
/**
* Define an in-world position.
*
* @param x The x-coordinate of the BlockPos.
* @param y The y-coordinate of the BlockPos.
* @param xCoord The x-coordinate of the BlockPos.
* @param yCoord The y-coordinate of the BlockPos.
*/
BlockPos(int x, int y) {
this->x = x;
this->y = y;
BlockPos(int xCoord, int yCoord) {
this->x = xCoord;
this->y = yCoord;
}
/**
* Define an in-world position.
*
* @param xCoord The x-coordinate of the BlockPos.
* @param yCoord The y-coordinate of the BlockPos.
*/
BlockPos(unsigned int xCoord, unsigned int yCoord) {
this->x = static_cast<int>(xCoord);
this->y = static_cast<int>(yCoord);
}
/**
@@ -56,12 +66,12 @@ public:
/**
* Add the given coordinates to the BlockPos.
*
* @param x The x-coordinate to add.
* @param y The y-coordinate to add.
* @param xOffset The x-coordinate to add.
* @param yOffset The y-coordinate to add.
* @return The BlockPos with the given coordinates added.
*/
BlockPos add(int x, int y) {
return BlockPos(this->x + x, this->y + y);
BlockPos add(int xOffset, int yOffset) {
return BlockPos(this->x + xOffset, this->y + yOffset);
}
BlockPos operator+(BlockPos offset) {
@@ -70,4 +80,4 @@ public:
BlockPos operator-(BlockPos offset) {
return BlockPos(this->getX() - offset.getX(), this->getY() - offset.getY());
}
};
};