using System.Threading.Tasks;
using Cirno.Scripts.Components.Actors;
using Cirno.Scripts.Components.FSM.Enemy;
using Cirno.Scripts.Enums;
using Godot;

namespace Cirno.Scripts.Components.FSM.Boss;

public partial class Idle : EnemyStateBase
{
    public override EnemyState StateId => EnemyState.Idle;
    
    [Export]
    public EnemyStorageModule StorageModule { get; private set; }
    
    [Export]
    public GenericDamageReceiver DamageReceiver { get; private set; }

    public override void EnterState()
    {
        base.EnterState();

        StorageModule.HomePosition = StateMachine.MainObject.GlobalPosition;
        
        DamageReceiver.ChangeState(false);
        GD.Print("Boss idle");
        _ = DelayStart();
    }

    private async Task DelayStart()
    {
        await Task.Delay(1000);
        ChangeState(EnemyState.Shooting);
    } 

    public override void ExitState()
    {
        base.ExitState();
        
    }

}