using System.Collections;
using UnityEngine;

namespace ftt.Gameplay.AI
{
    public class RefreshPatrolAfterChase : INode
    {
        MinotaurNodeData nodeData;

        float currentInterval;

        public RefreshPatrolAfterChase(MinotaurNodeData nodeData)
        {
            this.nodeData = nodeData;
        }

        /// <summary>
        /// Call to get the node data passed in the creation of the node.
        /// </summary>
        public MinotaurNodeData GetNodeData()
        {
            return nodeData;
        }

        public bool Run()
        {
            if (currentInterval >= nodeData.GetRefreshPatrolTime)
            {
                currentInterval = 0;
                return false;
            }

            currentInterval += Time.deltaTime;
            return true;
        }
    }
}