package common.ai;

import common.entity.npc.EntityNPC;

public class EntityAINpcInteract extends EntityAIWatchClosest2
{
    private int interactionDelay;
    private EntityNPC npc;

    public EntityAINpcInteract(EntityNPC npc)
    {
        super(npc, EntityNPC.class, 3.0F, 0.02F);
        this.npc = npc;
    }
    
//    public boolean shouldExecute()
//    {
//    	if(super.shouldExecute()) {
//    		if(this.closestEntity.isPlayer()) {
//    			this.closestEntity = null;
//    			return false;
//    		}
//    		return true;
//    	}
//    	return false;
//    }
    
    public void startExecuting()
    {
        super.startExecuting();

        if (this.closestEntity instanceof EntityNPC)
        {
            this.interactionDelay = 10;
        }
        else
        {
            this.interactionDelay = 0;
        }
    }
    
    public void updateTask()
    {
        super.updateTask();

        if (this.interactionDelay > 0)
        {
            --this.interactionDelay;

            if (this.interactionDelay == 0)
            {
                
            }
        }
    }
}
