// Arup Guha
// 10/5/2026
// VIPTicket Class for COP 3330 Program 5 Framework

public class VIPTicket extends Ticket {

	protected int curFoodEaten;
	protected int maxFoodAllowed;
	protected boolean metArtist;
	
	// Typical constructor.
	public VIPTicket(Money m, Date d, char myRow, int mySeat, int maxFood) {
		super(m, d, myRow, mySeat);
		maxFoodAllowed = maxFood;
		curFoodEaten = 0;
		metArtist = false;
	}
	
	// To String defines out a single ticket prints out.
	public String toString() {
		return super.toString()+" Seat: "+row+" "+seatNum;
	}
	
	// I get to eat units amount of food (or whatever my max allowable is, whichever
	// is less).
	public void eatFood(int units) {
		int actualEat = Math.min(maxFoodAllowed-curFoodEaten, units);
		System.out.println("With your VIP perks, you ate "+actualEat+" units of food.");
		curFoodEaten -= actualEat;
	}
	
	// Returns true if we got to meet the artist this time, false otherwise. IncompatibleClassChangeError
	// the latter case it means we already met them.
	public boolean meetArtist() {
	
		// Not allowed to go twice.
		if (metArtist) return false;
		
		// Yeah!
		metArtist = true;
		return true;
	}

}