package projectzombie.items.modifier;

import bdf.types.BdfObject;

public class ItemModifierClickCooldown extends ItemModifier
{
	long last;
	long wait;
	
	public ItemModifierClickCooldown() {
		wait = 500;
	}
	
	public ItemModifierClickCooldown(long wait) {
		this.wait = wait;
	}
	
	public void click() {
		last = System.currentTimeMillis();
	}
	
	public boolean canClick() {
		return (System.currentTimeMillis() - last > wait);
	}

	@Override
	public void BdfClassLoad(BdfObject bdf) {
	}

	@Override
	public void BdfClassSave(BdfObject bdf) {
	}

	@Override
	public boolean isEqual(ItemModifier other) {
		return true;
	}

	@Override
	public ItemModifier copy() {
		ItemModifierClickCooldown copy = new ItemModifierClickCooldown(wait);
		copy.last = last;
		return copy;
	}

}
