// Arup Guha
// 2/24/2026
// Position class to track a position on a Cartesian grid.

public class Position {

	private int x;
	private int y;
	
	// Creates a Position at (myx, myy).
	public Position(int myx, int myy) {
		x = myx;
		y = myy;
	}
	
	// Returns true iff this and other are the same Position.
	public boolean equals(Position other) {
		return x == other.x && y == other.y;
	}
	
	// Moves this Position by an offset of other.
	public void moveBy(Position other) {
		x += other.x;
		y += other.y;
	}
	
	// Changes this Position by (dx, dy).
	public void moveBy(int dx, int dy) {
		x += dx;
		y += dy;
	}
	
	// String representation of the object.
	public String toString() {
		return "("+x+", "+y+")";
	}
}