aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Pos.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/Pos.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/Pos.h')
-rw-r--r--Minecraft.World/Pos.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/Minecraft.World/Pos.h b/Minecraft.World/Pos.h
new file mode 100644
index 00000000..a07c7fe3
--- /dev/null
+++ b/Minecraft.World/Pos.h
@@ -0,0 +1,97 @@
+#pragma once
+// Pos implements Comparable<Pos>
+// We don't REALLY need it as it's main use it to make things easy
+// to handle in the java array/list classes, but adding to help
+// maintain as much original code as possible
+
+//class Pos //implements Comparable<Pos>
+class Pos
+{
+public:
+ int x;
+ int y;
+ int z;
+
+ Pos();
+
+ Pos(int x, int y, int z);
+
+ Pos(Pos *position);
+
+ //@Override
+ //public boolean equals(Object other)
+ bool equals(void *other);
+
+ int hashCode();
+
+ int compareTo(Pos *pos);
+
+ Pos *offset(int x, int y, int z);
+
+ void set(int x, int y, int z);
+
+ void set(Pos *pos);
+
+ Pos *above();
+
+ Pos *above(int steps);
+
+ Pos *below();
+
+ Pos *below(int steps);
+
+ Pos *north();
+
+ Pos *north(int steps);
+
+ Pos *south();
+
+ Pos *south(int steps);
+
+ Pos *west();
+
+ Pos *west(int steps);
+
+ Pos *east();
+
+ Pos *east(int steps);
+
+ void move(int x, int y, int z);
+
+ void move(Pos pos);
+
+ void moveX(int steps);
+
+ void moveY(int steps);
+
+ void moveZ(int steps);
+
+ void moveUp(int steps);
+
+ void moveUp();
+
+ void moveDown(int steps);
+
+ void moveDown();
+
+ void moveEast(int steps);
+
+ void moveEast();
+
+ void moveWest(int steps);
+
+ void moveWest();
+
+ void moveNorth(int steps);
+
+ void moveNorth();
+
+ void moveSouth(int steps);
+
+ void moveSouth();
+
+ double dist(int x, int y, int z);
+
+ double dist(Pos *pos);
+ float distSqr(int x, int y, int z);
+}; \ No newline at end of file