using Godot;

namespace Cirno.Scripts.Components.Actors;

public partial class DoorSpriteComponent : AnimatedSprite2D
{
    protected Door _door;
    
    public override void _Ready()
    {
        
        _door = GetParent<Door>();
        
        _door.DoorOpened += DoorOpened;
        _door.DoorClosed += DoorClosed;
    }

    protected virtual void DoorClosed()
    {
        this.Play("Closing");
    }

    protected virtual void DoorOpened()
    {
        this.Play("Opening");
    }
    
    
}