Because of a weird task requirement, folders are not allowed

Who tf came up with this limitation? Seriously...
This commit is contained in:
Martin Prokoph
2025-02-01 19:05:56 +01:00
parent d8ae57eb3e
commit 693c389e3f
25 changed files with 66 additions and 59 deletions

34
blockPos.hpp Normal file
View File

@@ -0,0 +1,34 @@
#pragma once
class BlockPos {
int x;
int y;
public:
BlockPos(int x, int y) {
this->x = x;
this->y = y;
}
int getX() {
return x;
}
int getY() {
return y;
}
unsigned int getUnsignedX() {
return static_cast<unsigned int>(x);
}
unsigned int getUnsignedY() {
return static_cast<unsigned int>(y);
}
bool isNegative() {
return x < 0 || y < 0;
}
BlockPos add(int x, int y) {
return BlockPos(this->x + x, this->y + y);
}
BlockPos operator+(BlockPos offset) {
return BlockPos(this->getX() + offset.getX(), this->getY() + offset.getY());
}
BlockPos operator-(BlockPos offset) {
return BlockPos(this->getX() - offset.getX(), this->getY() - offset.getY());
}
};