public class Food extends Obj implements java.io.Serializable {
	static final long serialVersionUID = 2L;
	
	public enum type {SHIT, YUKKURIFOOD, CAKE};
	
	private type foodType;
	private int amount;
	
	public Food(int initX, int initY, type initType) {
		objType = Type.FOOD;
		x = initX;
		y = initY;
		z = 0;
		foodType = initType;
		switch (initType)
		{
		case YUKKURIFOOD:
			amount = 60*60*2;
			break;
		case CAKE:
			amount = 60*60;
			break;
		default:
			amount = 60*60;
		}
		removed = false;
	}
	
	public type getFoodType() { return foodType; }
	
	public boolean isEmpty() { return (amount == 0); }
	
	public void eatFood(int eatAmount)
	{
		if (isEmpty()) { return; }
		amount -= eatAmount;
		if (amount < 0) { amount = 0; }
	}
	
	public Event clockTick()
	{
		if (removed) { return Event.REMOVED; }
		if (!grabbed && z > 0)
		{
			z -= 2;
			if (z <= 0) { z = 0; }
		}
		return Event.DONOTHING;
	}
}