aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Node.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/Node.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/Node.h')
-rw-r--r--Minecraft.World/Node.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/Minecraft.World/Node.h b/Minecraft.World/Node.h
new file mode 100644
index 00000000..6d2bdda8
--- /dev/null
+++ b/Minecraft.World/Node.h
@@ -0,0 +1,38 @@
+#pragma once
+using namespace std;
+
+class Node
+{
+ // 4J Jev, these classes were accessing protected members.
+ friend class BinaryHeap;
+ friend class PathFinder;
+ friend class EnderDragon;
+
+public:
+ const int x, y, z;
+
+private:
+ const int hash;
+
+protected:
+ int heapIdx;
+ float g, h, f;
+ Node *cameFrom;
+
+public:
+ bool closed;
+
+ void _init();
+ eINSTANCEOF GetType() { return eType_NODE;}
+
+ Node() : hash(0),x(0),y(0),z(0) {} // 4J - added default constructor so we can make an empty of array of these as a copy target
+ Node(const int x, const int y, const int z);
+
+ static int createHash(const int x, const int y, const int z);
+ float distanceTo(Node *to);
+ float distanceToSqr(Node *to);
+ bool equals(Node *o);
+ int hashCode();
+ bool inOpenSet();
+ wstring toString();
+};