using System.Collections;
using System.Collections.Generic;
using Core.State;
using GameLogic.Combat.Hero;
using GameLogic.Combat.Hero.State;
using UnityEngine;
using UnityEngine.AI;

public class CombatAIBasic
{
    public StateControl stateControl;

    public NavMeshAgent NavMeshAgent;

    protected CombatHeroEntity _combatHeroEntity;
    public void Init(CombatHeroEntity combatHeroEntity, NavMeshAgent navMeshAgent)
    {
        _combatHeroEntity = combatHeroEntity;
        stateControl = new StateControl();
        NavMeshAgent = navMeshAgent;
        ProInitState();
    }

    protected void ProInitState()
    {
        stateControl.AddState(CombatHeroStateType.idle,new CombatHeroIdleState(_combatHeroEntity));
        stateControl.AddState(CombatHeroStateType.move,new CombatHeroMoveState(_combatHeroEntity));
        stateControl.AddState(CombatHeroStateType.att,new CombatHeroAttState(_combatHeroEntity));
        stateControl.AddState(CombatHeroStateType.dile,new CombatHeroDieState(_combatHeroEntity));
    }

    public void ChangeState(string name)
    {
        stateControl.ChangeState(name);
    }

    public void Update(float t)
    {
        stateControl.Update(t);
    }
   
}