using Unity.VisualScripting;
using UnityEngine;

namespace BansheeGz.BGDatabase
{
    /// <summary>
    /// Abstract action for all SaveLoad related actions
    /// </summary>
    public abstract partial class SaveLoadA : Unit
    {
        protected const string FileExt = "sav";

        [DoNotSerialize] public ValueInput debug;

        protected override void Definition()
        {
            debug = ValueInput("Debug", false);
        }

        protected bool IsDebugging(Flow flow)
        {
            return flow.GetValue<bool>(debug);
        }

        protected void Log(Flow flow, string message, params object[] parameters)
        {
            if (!IsDebugging(flow)) return;
            Debug.Log("Debug [" + GetType().Name + "]: " + BGUtil.Format(message, parameters));
        }
    }
}