-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.java
More file actions
37 lines (30 loc) · 730 Bytes
/
Node.java
File metadata and controls
37 lines (30 loc) · 730 Bytes
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
package sample;
public class Node {
//Private variables.
private int _x, _y, _cScore;
private double _hScore;
//Creates a node at the given x and y Coords.
public Node (int x, int y){
_x = x;
_y = y;
_cScore = 1;
}
//Returns the X coord of this Node.
public int getX(){
return _x;
}
//Returns teh Y coord of this Node.
public int getY(){
return _y;
}
//Returns the H Value of this node.
public double getH(){
return _hScore;
}
//Returns the C Value of this Node.
public int getC(){return _cScore;}
//Sets this variables H Score.
public void setHScore(double score){
_hScore = score;
}
}