activeFields.getLast().steep.near = new Point2I(1, 0);
activeFields.getLast().steep.far = new Point2I(0, ady + 1);
Point2I dest = new Point2I(0, 0);
Line2I stopLine = new Line2I(new Point2I(0, 1), new Point2I(adx, ady + 1)), startLine = new Line2I(
new Point2I(1, 0), new Point2I(adx + 1, ady));
// Visit the source square exactly once (in quadrant 1).
actIsBlocked(state, dest);
CLikeIterator<fieldT> currentField = new CLikeIterator<fieldT>(
activeFields.listIterator());
int maxI = adx + ady;
// For each square outline
int lastStartJ = -1;
Point2I topLeft = new Point2I(0, 0), bottomRight = new Point2I(0, 0);
for (int i = 1; i <= maxI && !activeFields.isEmpty(); ++i)
{
// System.out.println("i "+i);
int startJ = max(0, i - adx);
startJ = max(startJ, lastStartJ - 1);
int maxJ = min(i, ady);
// System.out.println("Startj "+startJ+" maxj "+maxJ);
// Visit the nodes in the outline
int thisStartJ = -1;
// System.out.println("startJ "+startJ+" maxJ "+maxJ);
for (int j = startJ; j <= maxJ && !currentField.isAtEnd(); ++j)
{
// System.out.println("i j "+i+" "+j);
dest.x = i - j;
dest.y = j;
topLeft.x = dest.x;
topLeft.y = dest.y + 1;
bottomRight.x = dest.x + 1;
bottomRight.y = dest.y;
// System.out.println(startLine+" "+topLeft+" "+stopLine+"
// "+bottomRight);
// System.out.println("isbelow "+startLine.isBelow(topLeft)+"
// isabove "+stopLine.isAbove(bottomRight));
if (startLine.isAboveOrContains(topLeft))
{
// not in range, continue
// System.out.println("below start");
continue;
}