4jcraft/Minecraft.World/AI/Navigation/Node.h
2026-03-13 17:06:56 -05:00

42 lines
882 B
C++

#pragma once
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();
std::wstring toString();
};