Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Node implements Comparable
- {
- public Node parentNode;
- public int xPosition;
- public int yPosition;
- public int movementCost;
- public int totalCost;
- public Node(int x, int y)
- {
- movementCost = 0;
- xPosition = x;
- yPosition = y;
- }
- public boolean equals(Object obj)
- {
- Node cNode = (Node) obj;
- return (cNode.xPosition == xPosition && cNode.yPosition == yPosition);
- }
- public int compareTo(Object o)
- {
- Node cNode = (Node) o;
- return new Integer(totalCost).compareTo(cNode.totalCost);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement