/*
<copyright file="BGBDActionA.cs" company="BansheeGz">
    Copyright (c) 2018-2021 All Rights Reserved
</copyright>
*/

using System;
using BehaviorDesigner.Runtime.Tasks;
using UnityEngine;
using Action = BehaviorDesigner.Runtime.Tasks.Action;

namespace BansheeGz.BGDatabase
{
    public abstract class BGBDActionA : Action
    {
        public override TaskStatus OnUpdate()
        {
            try
            {
                Execute();
                return TaskStatus.Success;
            }
            catch (Exception e)
            {
                Debug.LogException(e);
                return TaskStatus.Failure;
            }
        }

        protected abstract void Execute();
    }
}