public Vector[] generatePath() {
		int xP = begin.getX(), yP = begin.getY();
		Vector v = new Vector(begin, end);
		Directions[] baseDirections = Direction.getDirectionByVector(v).isStraight() ? new Directions[] { Direction.getDirectionByVector(v) } : Direction.getDirectionByVector(v).split();
		Directions xD = baseDirections[0];
		Directions yD = baseDirections[1];
		List<Vector> l = new ArrayList<Vector>();
		int i = 1, xDiff = 0, yDiff = 0;
		while(!end.equals(t(xP, yP)) && l.size() < 10) {
			while(!Direction.directionPassable(yD, t(xP + xDiff, yP + yDiff)) && i < 10) {
				xDiff += i / 2 * xD.getX() * (i % 2 == 0 ? -1 : 1); 
				System.out.print(xDiff);
				i++;
			}
			while(Direction.directionPassable(yD, t(xP + xDiff, yP + yDiff)) && yP + yDiff < end.getY()) {
				yDiff += yD.getY();
			}
			yDiff += Direction.directionPassable(yD, t(xP + xDiff, yP + yDiff)) ? yD.getY() : - yD.getY();
			l.add(new Vector(t(xP, yP), t(xP + xDiff, yP + yDiff)));
			System.out.println(t(xP, yP) + " : " + t(xP + xDiff, yP + yDiff));
			xP += xDiff;
			yP += yDiff;
			xDiff = 0;
			yDiff = 0;
			i = 1;
		}
		System.out.println("Generated path with length " + l.size());
		return l.toArray(new Vector[l.size()]);
	}