/** * A helper class for the maze solver * * @author geoffreytowell * */ public class Coordinate { /** * The location on the first dimension of the maze */ private int d1; /** * The location along the second dimension of the maze */ private int d2; /** * Construct a coordinate using the given dimensions * @param d1 * @param d2 */ public Coordinate(int d1, int d2) { this.d1=d1; this.d2=d2; } /** * Construct a coordinate by adding the two given coordinates * @param starter * @param adder */ public Coordinate(Coordinate starter, Coordinate adder) { this.d1 = starter.getD1()+adder.getD1(); this.d2 = starter.getD2()+ adder.getD2(); } public int getD1() { return d1; } public void setD1(int d1) { this.d1 = d1; } public int getD2() { return d2; } public void setD2(int d2) { this.d2 = d2; } @Override public String toString() { return "<"+d1+","+d2+">"; } }