List<PointNode> getExteriorCorners()

Return a list of all the "exterior corners" of this Grid.

An "exterior corner" is defined as any walkable Node diagonally adjacent to a non-walkable Node that has 0 obstructions. An obstruction in defined in the doc string for the DiagonalMovement enum.

Source

List<PointNode> getExteriorCorners() {
  Set<PointNode> exteriorCorners = new Set<PointNode>();

  for (int x = 0; x < this.cols; x++) {
    for (int y = 0; y < this.rows; y++) {
      PointNode center = this.nodeFromPoint(new Point(x, y));
      if (!center.walkable) {
        exteriorCorners.addAll(
            this._getCorners(center, true, DiagonalMovement.WithNoObstructions));
      }
    }
  }

  return exteriorCorners.toList();
}