code: public void fill(Space target, float sx, float sy, float cost) {
  		if (cost >= this.cost) {
  			return;
  		}
  		this.cost = cost;
  		if (target == this) {
  			return;
  		}
  		
  		for (int i=0;i<getLinkCount();i++) {
  			Link link = getLink(i);
  			float extraCost = link.distance2(sx,sy);
  			float nextCost = cost + extraCost;
  			link.getTarget().fill(target, link.getX(), link.getY(), nextCost);
  		}
  	}
docs: Fill the spaces based on the cost from a given starting point
  
  @param target The target space we're heading for
  @param sx The x coordinate of the starting point
  @param sy The y coordinate of the starting point
  @param cost The cost up to this point