using Cirno.Scripts.Activables;
using Godot;

namespace Cirno.Scripts.Weapons;

public partial class AutoclearingBulletEmitter : BulletEmitter
{
    [Export]
    public float Timeout { get; private set; } = 5f;
    
    private double _timeoutTimer = 0f;

    public override void _Process(double delta)
    {
        base._Process(delta);
        if (!IsEmitting) return;
        _timeoutTimer += delta;

        if (_timeoutTimer >= Timeout)
        {
            QueueFree();
        }
    }
}