using Godot;
using Newlon.Components.Level;

namespace Newlon.Components.Plants;

public partial class PlantSunSpawner : Node2D
{
    [Export]
    private PackedScene _sunScene;
    [Export]
    private int _amountPerSun;

    public void Spawn()
    {
        var sun = _sunScene.Instantiate<Sun>();
        sun.amount = _amountPerSun;

        PoolContainer.Instance.Projectiles.AddChild(sun);
        sun.GlobalPosition = GlobalPosition;
    }
}
