public void checkNeighbours(Map map, ArrayList<Node> openlist, ArrayList<Node> closedlist){
			openlist.remove(this);
			closedlist.add(this);
			
			if(posX == goal.x && posY == goal.y){
				finalNode = this;
				return;
			}
			
			for(Direction dir: directions){
				Point newPosition = dir.nextPoint(posX, posY);
				
				if(!map.isSolid(newPosition)){
					/*
					 * if(newPosition.equals(goal)) { finalNode = new Node(this,
					 * newPosition); break; }
					 */

					Node newNode = new Node(this, newPosition.x, newPosition.y);
					
					//if(getEqualNode(closedlist, newNode) != null) continue;
					
					Node openNode = getEqualNode(openlist, newNode);
					if(openNode != null){
						if(openNode.g > newNode.g){
							openNode.parent = this;
							openNode.calculateG();
							openNode.calculateH();
						}
					}else{
						openlist.add(new Node(this, newPosition.x, newPosition.y));
					}
				}
			}
		}