// Arup Guha
// 2/24/2026
// Base class used in my "Pacman" game.

public class Piece {

	protected Position loc;
	protected Position dir;
	
	// Creates a piece at location start, with a movement direction of delta.
	public Piece(int x, int y, int dx, int dy) {
		loc = new Position(x, y);
		dir = new Position(dx, dy);
	}
	
	// Executes a single move of this Piece.
	public void move() {
		loc.moveBy(dir);
	}
	
	// Returns where this Piece is.
	public Position getLoc() {
		return loc;
	}
	
	// String representation of a generic piece.
	public String toString() {
		return "Piece at "+loc.toString();
	}
	
}