using Game.Extensions;
using Godot;

namespace Game;

public partial class CurrentTimeLine : Panel
{
    [Export]
    public float Speed = 15f;

    private bool _running;

    public override void _Process(double delta)
    {
        if (!_running)
            return;

        var pos = OffsetTransformPosition;
        pos.Y += Speed * DoubleExtensions.toFloat(delta);

        OffsetTransformPosition = pos;
    }

    public void Start()
    {
        _running = true;
    }

    public void Stop()
    {
        _running = false;
        OffsetTransformPosition = Vector2.Zero;
    }
}
