using Godot;
using System;
using DungeonRPG.Scripts.General;

public partial class PlayerDashState : Node
{
    private Player characterNode;

    public override void _Ready()
    {
        characterNode = GetOwner<Player>();
        SetPhysicsProcess(false);
        SetProcessInput(false);

    }
    
    public override void _PhysicsProcess(double delta)
    {
        
    }
    
    

    public override void _Notification(int what)
    {
        base._Notification(what);

        if (what == GameConstants.STATE_NOTIFICATION_ENABLE)
        {
            characterNode.AnimatedSprite.Play(GameConstants.ANIM_DASH);
            SetPhysicsProcess(true);
            SetProcessInput(true);

        }
        else if (what == GameConstants.STATE_NOTIFICATION_DISABLE)
        {
            SetPhysicsProcess(false);
            SetProcessInput(false);

        }
    }
}