// Path: src/model/Position.java
// public class Position {
// 
// 	public int x;
// 	public int y;
// 
// 	public Position(int x, int y) {
// 		super();
// 		this.x = x;
// 		this.y = y;
// 	}
// 
// 	public Position() {
// 		super();
// 		x = 0;
// 		y = 0;
// 	}
// 
// 	public Direction getDirection(Position pos) {
// 		if (pos == null)
// 			return null;
// 		return Direction.direction(pos.x - x, pos.y - y);
// 	}
// 
// 	public int hashCode() {
// 		int result = 1;
// 		result = 5 * result + x;
// 		result = 5 * result + y;
// 		return result;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "(" + x + "," + y + ")";
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		final Position other = (Position) obj;
// 		if (x != other.x)
// 			return false;
// 		if (y != other.y)
// 			return false;
// 		return true;
// 	}
// 
// 	public int distance(Position to) {
// 		int xx = x - to.x;
// 		if (xx < 0)
// 			xx = xx * (-1);
// 		int yy = y - to.y;
// 		if (yy < 0)
// 			yy = yy * (-1);
// 		return xx + yy;
// 	}
// 
// }


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import model.Position;
			public void remove() {
				throw new UnsupportedOperationException();
			}
		};
	}

	/**
	 * Position iterator based on Bresenham's algorithm for a line starting at a
	 * given point, with an angle given by the provided x and y deltas. <b>The
	 * Position returned by the iterator will always be the same object for
	 * efficiency; if you need to hold on to it, you should clone it first.<b>
	 * <b>Note: The returned iterator is infinite; that is it won't ever
	 * end.</b>
	 * 
	 * @param x0
	 *            the x-ordinate of the start point
	 * @param y0
	 *            the y-ordinate of the start point
	 * @param fdx
	 *            the x-gradient
	 * @param fdy
	 *            the y-gradient
	 * @return an iterator over the Positions in the line
	 */
	public static Iterator<Position> bresenham(final int x0, final int y0,
			final float fdx, final float fdy) {
		return new Iterator<Position>() {
			int x = x0;
			int y = y0;
			final float dx = Math.abs(fdx);
// Path: src/model/Position.java
// public class Position {
// 
// 	public int x;
// 	public int y;
// 
// 	public Position(int x, int y) {
// 		super();
// 		this.x = x;
// 		this.y = y;
// 	}
// 
// 	public Position() {
// 		super();
// 		x = 0;
// 		y = 0;
// 	}
// 
// 	public Direction getDirection(Position pos) {
// 		if (pos == null)
// 			return null;
// 		return Direction.direction(pos.x - x, pos.y - y);
// 	}
// 
// 	public int hashCode() {
// 		int result = 1;
// 		result = 5 * result + x;
// 		result = 5 * result + y;
// 		return result;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "(" + x + "," + y + ")";
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		final Position other = (Position) obj;
// 		if (x != other.x)
// 			return false;
// 		if (y != other.y)
// 			return false;
// 		return true;
// 	}
// 
// 	public int distance(Position to) {
// 		int xx = x - to.x;
// 		if (xx < 0)
// 			xx = xx * (-1);
// 		int yy = y - to.y;
// 		if (yy < 0)
// 			yy = yy * (-1);
// 		return xx + yy;
// 	}
// 
// }


// Path: src/util/LineIterators.java
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import model.Position;

			public void remove() {
				throw new UnsupportedOperationException();
			}
		};
	}

	/**
	 * Position iterator based on Bresenham's algorithm for a line starting at a
	 * given point, with an angle given by the provided x and y deltas. <b>The
	 * Position returned by the iterator will always be the same object for
	 * efficiency; if you need to hold on to it, you should clone it first.<b>
	 * <b>Note: The returned iterator is infinite; that is it won't ever
	 * end.</b>
	 * 
	 * @param x0
	 *            the x-ordinate of the start point
	 * @param y0
	 *            the y-ordinate of the start point
	 * @param fdx
	 *            the x-gradient
	 * @param fdy
	 *            the y-gradient
	 * @return an iterator over the Positions in the line
	 */
	public static Iterator<Position> bresenham(final int x0, final int y0,
			final float fdx, final float fdy) {
		return new Iterator<Position>() {
			int x = x0;
			int y = y0;
			final float dx = Math.abs(fdx);
			final float dy = Math.abs(fdy);