// Arup Guha
// 2/24/2026
// Fruit is a Piece
// Edited on 3/8/2026 for Abstract class lecture

public class Fruit extends Piece {
	
	private String name;
	private String color;
	private int points;
	
	// Build my fruit!!!
	public Fruit(Position p, Position dir, String myName, String myColor, int myPoints) {
		super(p, dir); 
		name = myName;
		color = myColor;
		points = myPoints;
	}
	
	// String representation of this Fruit.
	public String toString() {
		return name+" color "+color+" at "+loc+" worth "+points;
	}
	
	// Returns the number of points this Fruit is worth.
	public int getPoints() {
		return points;
	}
	
	// A fruit's code will be its first letter.
	public char getCode() {
		return name.charAt(0);
	}

}