From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/Node.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Minecraft.World/Node.h (limited to 'Minecraft.World/Node.h') 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(); +}; -- cgit v1.2.3