using Godot;
using Newlon.Components.Level;

namespace Newlon.Components.Plants;

//
// Data that plant stores during runtime
//

public partial class RuntimePlantData : Entity
{
    public int Line { get; set; }
    public PlantResource Resource;
    private AudioStream eatenSound = ResourceLoader.Load<AudioStream>("res://assets/audio/sfx/gulp.mp3");
    public override void KillByDamage()
    {
        AudioSequencer.Play("plant_eaten", eatenSound);
        base.KillByDamage();
    }
    public override void Kill()
    {
        PoolContainer.Instance.EntityField[Resource.Layer].Remove(GlobalPosition);
        QueueFree();
    }
}
