aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Node.h
blob: 6d2bdda861eb28a9b6e697f50fafb0182b3b2ad2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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();
};