-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNode.cs
81 lines (75 loc) · 1.51 KB
/
Node.cs
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PathAlgorithms
{
/* Node used in A* algorithm */
class Node
{
int x, y, F, G, H;
public Node(int _x, int _y)
{
x = _x;
y = _y;
F = 0;
G = 0;
H = 0;
}
public int getX()
{
return x;
}
public int getY()
{
return y;
}
public int getG()
{
return G;
}
public int getF()
{
return F;
}
public int getH()
{
return H;
}
public void setX(int _x)
{
x = _x;
}
public void setY(int _y)
{
y = _y;
}
public void setF(int _F)
{
F = _F;
}
public void setH(int _H)
{
H = _H;
}
public void setG(int _G)
{
G = _G;
}
public static bool operator ==(Node lhs, Node rhs)
{
bool status = false;
if (lhs.x == rhs.x && lhs.y == rhs.y)
status = true;
return status;
}
public static bool operator !=(Node lhs, Node rhs)
{
bool status = true;
if (lhs.x == rhs.x && lhs.y == rhs.y)
status = false;
return status;
}
}
}