/** * A helper class for the maze solver * * @author geoffreytowell Created: Sep 2019 * */ public class Coordinate { /** * The location on the first dimension of the maze */ private final int d1; /** * The location along the second dimension of the maze */ private final 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 int getD2() { return d2; } @Override public String toString() { return "<" + d1 + "," + d2 + ">"; } }