using ParadoxNotion.Design;
using UnityEngine;

namespace BansheeGz.BGDatabase
{
    [Category("BansheeGz")]
    [Name("SL: Load game from binary array")]
    [Description("Load saved game from binary array")]
    public class BGFCLoadGameFromArray : BGFCSaveLoadA
    {
       
        protected override void RegisterPorts()
        {

            base.RegisterPorts();
            var databaseContent = AddValueInput<byte[]>("Database content");
            var _out = AddFlowOutput("_out");
            AddFlowInput("_in", flow =>
            {
                var content = databaseContent.value;
                if (content == null)
                {
                    Log( "Unable to load database- content is null");
                }
                else
                {
                    BGRepo.I.Addons.Get<BGAddonSaveLoad>().Load(content);
                }
                _out.Call(flow);
            });

        }
    }
}